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
Release history Release notifications | RSS feed
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.5.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file mysqllib-1.0.5.tar.gz
.
File metadata
- Download URL: mysqllib-1.0.5.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f8de64d3abbcbe0ccfeefe96ae7cf83b128aabcd1d09b711a4bda2dd841b924 |
|
MD5 | 217da494ed7fc3c3051c9d1cffb6aca0 |
|
BLAKE2b-256 | a6f3efc78a00249f1299dfa373f577704d0c54bef8d000b2c84515917d586e6d |
File details
Details for the file mysqllib-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: mysqllib-1.0.5-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0360d75750c4ec8016d2a0909bb018822104689667054358270d2ce2f89b7ec |
|
MD5 | 91c2aab4157a88b5e20038e65bd86887 |
|
BLAKE2b-256 | 57423b8e404a255ff4b142ebbad0459a5439d0e09a2e967ecc447145e6b53964 |