Skip to main content

database_wrapper_mysql

Part of the database_wrapper package.

This python package is a database wrapper for MySQL and MariaDB database.

Installation

pip install database_wrapper[mysql]

Usage

from database_wrapper_mysql import MySQL, DBWrapperMySQL

db = MySQL({
    "hostname": "localhost",
    "port": 3306,
    "username": "root",
    "password": "your_password",
    "database": "my_database"
})
db.open()
dbWrapper = DBWrapperMySQL(dbCursor=db.cursor)

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

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_mysql-0.3.146.tar.gz (5.2 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_mysql-0.3.146-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for database_wrapper_mysql-0.3.146.tar.gz
Algorithm Hash digest
SHA256 3373b08e05d1dcf0e9b69b18974802a874681e06b7b7b00d6725ca84ad4e3bbf
MD5 a4b10af01dd7ed83c25e6e3c5e47f47b
BLAKE2b-256 207344fb20aec88bd417346de8408a0199d56eb8b2489bacee774b2b34895932

See more details on using hashes here.

Provenance

The following attestation bundles were made for database_wrapper_mysql-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_mysql-0.3.146-py3-none-any.whl.

File metadata

File hashes

Hashes for database_wrapper_mysql-0.3.146-py3-none-any.whl
Algorithm Hash digest
SHA256 266885008ef0ff448b12208f16765e9a4730575371ca25314989458a26cc89b7
MD5 5af2643973be1166f83ede6339481d74
BLAKE2b-256 6b030dfe7a46bb35be000f57e48f11a6ab0cab668cc9c5a1a5bafe5692f8dd96

See more details on using hashes here.

Provenance

The following attestation bundles were made for database_wrapper_mysql-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