A Python package for working with SQLite databases in the cloud.
Project description
Python SDK for SqliteCloud
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.
Installation
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.
Usage
from sqlitecloud.client import SqliteCloudClient, SqliteCloudAccount
Init a connection
Using explicit configuration
account = SqliteCloudAccount(user, password, host, db_name, port)
client = SqliteCloudClient(cloud_account=account)
conn = client.open_connection()
Using string configuration
account = SqliteCloudAccount("sqlitecloud://user:pass@host.com:port/dbname?timeout=10&key2=value2&key3=value3")
client = SqliteCloudClient(cloud_account=account)
conn = client.open_connection()
Execute a query
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
)
Iterate result
result is an iterable object
for row in result:
print(row)
Close connection
client.disconnect(conn)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for SqliteCloud-0.0.30-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa08c2ad1877961586e8f1691debabe8b64d26530368f56460de3043cad9452 |
|
MD5 | f9813ea7942094036b76215ecfb89611 |
|
BLAKE2b-256 | f0acd003d6e698b805fd2c83911d32da8b8a61ff51574c93f240ddf7354630e8 |