Skip to main content

Python SQLite Client and Server

Project description

sqlite_rx

PyPI version sqlite-rx Downloads

Python 3.10 Python 3.11 Python 3.12 Python 3.13 Python 3.14

PyPy3.10 PyPy3.11

For documentation, usage and examples refer https://aosingh.github.io/sqlite_rx/

Introduction

SQLite is a lightweight database written in C. Python has in-built support to interact with the database (locally) which is either stored on disk or in memory.

With sqlite_rx, clients should be able to communicate with an SQLiteServer in a fast, simple and secure manner and execute queries remotely.

Key Features

Install

pip install -U sqlite_rx

Server

SQLiteServer runs in a single thread and follows an event-driven concurrency model (using tornado's event loop) which minimizes the cost of concurrent client connections. Following snippet shows how you can start the server process.

# server.py

from sqlite_rx.server import SQLiteServer

def main():

    # database is a path-like object giving the pathname
    # of the database file to be opened.

    # You can use ":memory:" to open a database connection to a database
    # that resides in RAM instead of on disk

    server = SQLiteServer(database=":memory:",
                          bind_address="tcp://127.0.0.1:5000")
    server.start()
    server.join()

if __name__ == '__main__':
    main()

Client

The following snippet shows how you can instantiate an SQLiteClient and execute a simple CREATE TABLE query.

# client.py

from sqlite_rx.client import SQLiteClient

client = SQLiteClient(connect_address="tcp://127.0.0.1:5000")

with client:
  query = "CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)"
  result = client.execute(query)
>> python client.py

{'error': None, 'items': []}

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

sqlite_rx-1.3.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlite_rx-1.3.0-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file sqlite_rx-1.3.0.tar.gz.

File metadata

  • Download URL: sqlite_rx-1.3.0.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sqlite_rx-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b7d4a71174c8881837b3a2f7bfe843d74f675b32d5e552af435402ca639f8aa3
MD5 e56fbff111339deae218d9b47960cbe8
BLAKE2b-256 fdf0c3b5a1356abd8b842413a0a7859817cbbeea50e2b48efb82c0c1ba385070

See more details on using hashes here.

File details

Details for the file sqlite_rx-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: sqlite_rx-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sqlite_rx-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44ba297fcaf9dd5c396628723eac7dde2c06c4cb13a7deb8a3d9155ed428f146
MD5 c94a29ae43b7d1007bf40b0d105e884f
BLAKE2b-256 1f42f0e27988c82603cf1ec6fb9a2a8a98879a4690651c002b041bf0d96d8371

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page