Skip to main content

a Database Wrapper for Redis and MySQL

from DBService import MysqlService

    mysql_server = MysqlService(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_DB)
    # query
    mysql_server.query("SELECT * FROM TABLE")
    # execute
    mysql_server.execute("UPDATE from TABLES SET a = 55 WHERE id = 1")
    # transaction
    mysql_server.query(["UPDATE from TABLES SET a = 55 WHERE id = 1","UPDATE from TABLES SET a = 545 WHERE id = 2"])

from DBService import RedisService

    redis_server = RedisService("redis://:user@host:port/db")

from DBService import PgsqlService

    pgsql_server = PgsqlService(PGSQL_HOST, PGSQL_USER, PGSQL_PASSWORD, PGSQL_PORT, PGSQL_DB)
    # query
    pgsql_server.query("SELECT * FROM TABLE")
    # execute
    pgsql_server.execute("UPDATE from TABLES SET a = 55 WHERE id = 1")
    # transaction
    pgsql_server.query(["UPDATE from TABLES SET a = 55 WHERE id = 1","UPDATE from TABLES SET a = 545 WHERE id = 2"])

also support async,use them just add 'await'

    from DBService import AsyncRedisService,AsyncMysqlService,AsyncPgsqlService
    redis_server = AsyncRedisService("redis://:user@host:port/db")
    mysql_server = AsyncMysqlService(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_DB)
    pgsql_server = AsyncPgsqlService(PGSQL_HOST, PGSQL_USER, PGSQL_PASSWORD, PGSQL_PORT, PGSQL_DB)
    # or pgsql_server = AsyncPgsqlService(dsn="postgresql://username:password@localhost:5432/mydatabase")

Metadata

Release files for DBService 2.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DBService 2.1.3
File Size Uploaded
dbservice-2.1.3.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DBService 2.1.3
File Interpreter ABI Platform
dbservice-2.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / dbservice-2.1.3.tar.gz

Download URL dbservice-2.1.3.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
73e7cf2a2d4b434f03d991fd6b20d7cca2b7482fa7fc631c8d0bed3fc8da5640
BLAKE2b-256 checksum
How to use checksums
5c6a91e4e7ac10af4f5a067b772d8849eb820814f511a2c84597927c03f3fe9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release files / dbservice-2.1.3-py3-none-any.whl

Download URL dbservice-2.1.3-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e21bf9bed4783318551c0ccb6b4231dc14e4fdf25a125ce39e30ef3d8be8f25
BLAKE2b-256 checksum
How to use checksums
684e0b09de6c8972375511a54899da43d4f08687ecc9601ae8c0d5b0a1047732
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

2.1.3 This release

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.2

2 release files

2.0.0

2 release files

1.8.4

1 release file

1.8.3

1 release file

1.8.2

1 release file

1.8.1

1 release file

1.8

1 release file

1.6.3

1 release file

1.6

1 release file

1.5

1 release file

1.4

2 release files

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page