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.6.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

mysqllib-1.0.6-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mysqllib-1.0.6.tar.gz
  • Upload date:
  • Size: 6.2 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.6.tar.gz
Algorithm Hash digest
SHA256 d9c3d8c8f91d0942b5e8109b25952c8ad35daacecaa03b8868308d3faaec1f14
MD5 4b3b99e45706831ed500ee3a60c641af
BLAKE2b-256 2bbbbdf507fdde686a91844cecfb935a1a09bfcbc130de1734f216d9ec2699e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysqllib-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 079af8a0db416c86ee6cb97871dcc600711b469ef7fc74c7b9bade81b7a266de
MD5 db1af18a56d03d6aeba18b94f1653e8f
BLAKE2b-256 b494708876ec9f4f3620de20ebd65dcd2cf3c200d91c2ca77bb66a7185251715

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