Skip to main content

database_wrapper for PostgreSQL database

Project description

database_wrapper_sqlite

Part of the database_wrapper package.

This python package is a database wrapper for sqlite database.

!!! IMPORTANT !!!

This package is not yet implemented. The README is a placeholder for future implementation.

Installation

pip install database_wrapper[sqlite]

Usage

from database_wrapper_sqlite import Sqlite, DBWrapperSqlite

db = Sqlite({
    "database": "my_database.db",
})
db.open()
dbWrapper = DBWrapperSqlite(db=db)

# Simple query
aModel = MyModel()
res = await dbWrapper.getByKey(
    aModel,
    "id",
    3005,
)
if res:
    print(f"getByKey: {res.toDict()}")
else:
    print("No results")

# Raw query
res = await dbWrapper.getAll(
    aModel,
    customQuery="""
        SELECT t1.*, t2.name AS other_name
        FROM my_table AS t1
        LEFT JOIN other_table AS t2 ON t1.other_id = t2.id
    """
)
async for record in res:
    print(f"getAll: {record.toDict()}")
else:
    print("No results")

db.close()

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

database_wrapper_sqlite-0.1.42.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

database_wrapper_sqlite-0.1.42-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file database_wrapper_sqlite-0.1.42.tar.gz.

File metadata

File hashes

Hashes for database_wrapper_sqlite-0.1.42.tar.gz
Algorithm Hash digest
SHA256 ca8d4ac761aabce94a234ec974fb0a55e0875fd5b5a19adc8cb730135666ce06
MD5 c58af80781600cf8749622862c091bf6
BLAKE2b-256 ea1059e04d415be988bcad0a0e3c20f298127b3f663f70d6a90ee9e024549483

See more details on using hashes here.

Provenance

The following attestation bundles were made for database_wrapper_sqlite-0.1.42.tar.gz:

Publisher: master.yml on gintsmurans/py_database_wrapper

Attestations:

File details

Details for the file database_wrapper_sqlite-0.1.42-py3-none-any.whl.

File metadata

File hashes

Hashes for database_wrapper_sqlite-0.1.42-py3-none-any.whl
Algorithm Hash digest
SHA256 24e1ec958de3f966238beb5c1b8484333a4f656c48c68de30501be2a1cb771f0
MD5 738601ba26e57465364aa2e47a6c0613
BLAKE2b-256 daea41f1a18671872161b20aa7d4d46bbc3228d7f069baeaeb3eeb68a5667ef5

See more details on using hashes here.

Provenance

The following attestation bundles were made for database_wrapper_sqlite-0.1.42-py3-none-any.whl:

Publisher: master.yml on gintsmurans/py_database_wrapper

Attestations:

Supported by

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