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
It is very important to make the connection to the database that we are going to use.
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.1.tar.gz
(5.0 kB
view details)
File details
Details for the file db-querybuilder-0.1.1.tar.gz
.
File metadata
- Download URL: db-querybuilder-0.1.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e03de0b8a396065ebf069d085e2c1a5f3b62e2d4b0117b3d306d5a271b737ed |
|
MD5 | 0b11a8b6a4dd15988805db715c8e61bb |
|
BLAKE2b-256 | d83ff1e64c737cffdacd5d7ab68f9710402bca97c89caa7ecc9e914eafdc550a |