Skip to main content

database_wrapper_pgsql

Part of the database_wrapper package.

This python package is a database wrapper for PostgreSQL (also called pgsql) database.

Installation

pip install database_wrapper[pgsql]

Usage

from database_wrapper_pgsql import PgSQLWithPoolingAsync, DBWrapperPgSQLAsync

db = PgSQLWithPoolingAsync({
    "hostname": "localhost",
    "port": 3306,
    "username": "root",
    "password": "your_password",
    "database": "my_database"
})
await db.openPool()
try:
    async with db as (dbConn, dbCursor):
        dbWrapper = DBWrapperPgSQLAsync(dbCursor=dbCursor)

        # 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")

finally:
    await db.openPool()

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_pgsql-0.3.146.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

database_wrapper_pgsql-0.3.146-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file database_wrapper_pgsql-0.3.146.tar.gz.

File metadata

  • Download URL: database_wrapper_pgsql-0.3.146.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for database_wrapper_pgsql-0.3.146.tar.gz
Algorithm Hash digest
SHA256 f8e6ef79c2f2d1c24a94ccbe1e620f5962b6c80d7dbad29e98aec629e7311f42
MD5 cdf95e61460e946c6141a71ccc54bfaf
BLAKE2b-256 69e4db82be8efeee550502b6a17bf18056872e026fffd2b6f7e816dac309581a

See more details on using hashes here.

Provenance

The following attestation bundles were made for database_wrapper_pgsql-0.3.146.tar.gz:

Publisher: master.yml on 4Apps/py_database_wrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file database_wrapper_pgsql-0.3.146-py3-none-any.whl.

File metadata

File hashes

Hashes for database_wrapper_pgsql-0.3.146-py3-none-any.whl
Algorithm Hash digest
SHA256 102f83063ade2263d68a6aa040e1abe40d8e00d19278e6424a5048fd98b24248
MD5 b02e854a0f26b811330345767ba5b8e5
BLAKE2b-256 3b46f1b8b478f3b0e28e18d10cdb1f0922f25849d64e631fae6d067b0f548ff0

See more details on using hashes here.

Provenance

The following attestation bundles were made for database_wrapper_pgsql-0.3.146-py3-none-any.whl:

Publisher: master.yml on 4Apps/py_database_wrapper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.146 This release

2 files

0.2.38

2 files

0.2.36

2 files

0.2.33

2 files

0.2.32

2 files

0.2.31

2 files

0.2.30

2 files

0.2.27

2 files

0.2.26

2 files

0.2.24

2 files

0.2.23

2 files

0.2.17

2 files

0.2.16

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.9

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

1 file

0.2.2

2 files

0.1.90

2 files

0.1.89

2 files

0.1.88

2 files

0.1.87

2 files

0.1.86

2 files

0.1.85

2 files

0.1.84

2 files

0.1.82

2 files

0.1.80

2 files

0.1.78

2 files

0.1.76

2 files

0.1.75

2 files

0.1.74

2 files

0.1.73

2 files

0.1.72

2 files

0.1.44

2 files

0.1.43

2 files

0.1.42

2 files

0.1.40

2 files

0.1.38

2 files

0.1.37

2 files

0.1.33

2 files

0.1.32

2 files

0.1.29

1 file

0.1.28

2 files

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