Library to execute query builder
Project description
Database Query Builder
- A library that serves as a means of connecting to a database and executing sql statements.
Installation 😀📚
pip install db_querybuilder
Get started
How to use Database Query Builder
from db_querybuilder import DatabaseQueryBuilder
class TestUser():
def __init__(self) -> None:
self.id = -1
self.first_name = 'Jhon'
self.last_name = 'Doe'
if __name__ == '__main__':
db = DatabaseQueryBuilder(db_user='root',db_password='',db_database='test',db_port=3306)
# Query to json
query = db.setTable('test_data').query().where(clausule='id',parameter=1).toJson()
print(query)
# Query select
query = db.select(['id','first_name']).from_('test_data').where('email','emaffini0@mlb.com').results()
print(query)
# Insert data with attributes object
user = TestUser()
query = db.insert(table='test_data',object=user)
print(query)
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
db-querybuilder-0.1.0.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file db-querybuilder-0.1.0.tar.gz
.
File metadata
- Download URL: db-querybuilder-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 269d4cd67a2cdb34334be47c67c12d7e12e60f6d5e2adcd4509a1e1bbe246b8c |
|
MD5 | c6e3920d29a5b76a72f78c842604d348 |
|
BLAKE2b-256 | b9936e283d47c1f44e779e57bc66637e4fddefd65536f412bdcbf9dfa3947bd0 |
File details
Details for the file db_querybuilder-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: db_querybuilder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bea79e4d5caacfa1df56ca0230dae25e063dcb1bdf465138698c46272881cf0 |
|
MD5 | a2f4db4bb34550672ad96aef72873d92 |
|
BLAKE2b-256 | 7b82b048eb8e69e613cf70dfa62b4d8470595ff6d4a06d8c76dd0df1bc821bab |