Skip to main content

lib for auto model sql queries

Project description

dbautomodel

lib for auto model sql queries

Example:

import asyncio
from dbautomodel.module import DatabaseSqliteAPI


async def main():
    queries = [
        "CREATE TABLE users (user_id INTEGER PRIMARY KEY, name TEXT, email TEXT)",
        "CREATE TABLE messages (id INTEGER PRIMARY KEY, user_id INTEGER, message TEXT)"
    ]
    db = DatabaseSqliteAPI("./db.db", first_queries=queries)

    for user in await db.gets("users"):
        print(user.user_id)
        print(user.name)
        print(user.email)

    for message in await db.gets("messages"):
        print(message.id)
        print(message.user_id)
        print(message.message)


asyncio.run(main())

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

dbautomodel-0.0.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

dbautomodel-0.0.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file dbautomodel-0.0.1.tar.gz.

File metadata

  • Download URL: dbautomodel-0.0.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for dbautomodel-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f669c7c51ebe0c6c4bbadf587701b93816c3dd127722799f7b9935b1e2fb2ed6
MD5 55dc783ac1dd6e551770563233a41a53
BLAKE2b-256 400c3caa7799a7532210e5b9fe58a5f98fb0a07cf069f8dc65be8b062c898997

See more details on using hashes here.

File details

Details for the file dbautomodel-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dbautomodel-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for dbautomodel-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b1362de44692e8a222d26644a11be2a5a838ed870af2f579263acdae3ceb6c1
MD5 f4a3152b1deb1274473c07f7a996400c
BLAKE2b-256 d4c850a599f1dc14e7e21ba6f0d9518f0aa619245d149738f87cd3a2ed7b7b4c

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