Skip to main content

Simple mysql database library

Project description

Mysqllib

Simple mysql database

Connect

connect(
        user: str,
        password: str,
        database: str,
        host: str='127.0.0.1',
        port: int=3306
)

Fetch one

fetchone(query, args=None) -> Optional[dict]

Fetch all

fetchall(query, args=None) -> Optional[list]:

Execute

execute(query, args=None) -> bool:

find

def find(
        table: str,
        conditions: Dict[str, Union[str, List]] = None,
        columns='*',
        joins: Optional[List[Tuple[str, str, str]]] = None,
        order_by=None
) -> dict

findall

def findall(
        table: str,
        conditions: Dict[str, Union[str, List]] = None,
        columns='*',
        joins: Optional[List[Tuple[str, str, str]]] = None,
        group_by=None,
        order_by=None,
        limit=None
) -> list

update

def update(
        table: str,
        data: Dict[str, any],
        conditions: Optional[Dict[str, any]] = None
) -> bool

delete

def delete(
        table: str,
        conditions: Optional[Dict[str, any]] = None
)

insert

def create(
        table: str,
        data: Dict[str, any]
) -> bool

Mirations

Run

import mysqllib.migration

mysqllib.migration.run_migration('./path/to/migration/directory/')

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

mysqllib-1.0.4.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

mysqllib-1.0.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file mysqllib-1.0.4.tar.gz.

File metadata

  • Download URL: mysqllib-1.0.4.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for mysqllib-1.0.4.tar.gz
Algorithm Hash digest
SHA256 2a9ce415d90ce3fc93895bfd139ec860942e479de0a3dd416ab4ca817bdeb994
MD5 aec6c85e06a953ee0267c122a2f6277c
BLAKE2b-256 ae1e3a876c88937789be4b5c2a57c7cc8c3d3d00144870ed0b7287b18b8c2b73

See more details on using hashes here.

File details

Details for the file mysqllib-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: mysqllib-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for mysqllib-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b9f6b03b8759edb292254273beed57419ea67f8a29371d8c760884f17c66050f
MD5 7a478a279d2f96a7f30987521b047615
BLAKE2b-256 4d95c994375a3629e510d4fd165a00543f405a68bd7e2716a98a9b2c6c30b0a7

See more details on using hashes here.

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