SQLiteCloud is a powerful Python package that allows you to interact with the SQLite Cloud backend server seamlessly. It provides methods for various database operations. This package is designed to simplify database operations in Python applications, making it easier than ever to work with SQLite Cloud.
You can install SqliteCloud Package using Python Package Index (PYPI):
$ pip install SqliteCloud-
Follow the instructions reported here https://github.com/sqlitecloud/sdk/tree/master/C to build the driver.
-
Set SQLITECLOUD_DRIVER_PATH environment variable to the path of the driver file build.
from sqlitecloud.client import SqliteCloudClient, SqliteCloudAccountaccount = SqliteCloudAccount(user, password, host, db_name, port)
client = SqliteCloudClient(cloud_account=account)
conn = client.open_connection()account = SqliteCloudAccount("sqlitecloud://user:pass@host.com:port/dbname?timeout=10&key2=value2&key3=value3")
client = SqliteCloudClient(cloud_account=account)
conn = client.open_connection()You can bind values to parametric queries: you can pass parameters as positional values in an array
result = client.exec_statement(
"SELECT * FROM table_name WHERE id = ?",
[1],
conn=conn
)result is an iterable object
for row in result:
print(row)client.disconnect(conn)