Connect
In order to establish a connection to the LeanXcale SQL interface, you need to provide the following parameters within your DBAPI URL:
IP/hostname (e.g., 123.45.67.89)
Port (default: 14420)
Database name (default: db)
Username (default: lxadmin)
Password (default: foobar)
The initial stage in setting up a connection between SQLAlchemy and LeanXcale involves the creation of an engine. This engine is configured with a particular dialect, which instructs it on how to interact with the underlying DBAPI.
import lxdbapi
url = 'leanxcale://lxadmin@123.45.67.89:14420/db'
conn = lxpy.connect(url, password='foobar')
try:
conn = engine.raw_connection()
# Use conn as connection to access a LeanXcale database
finally:
# To close the connection
conn.close()