python mysql OOP class
Project description
mysql
mysql Object Oriented
touch .env #and edit .env file
project root path command run 'touch .env' and paste environment config
DB_HOST = "127.0.0.1" #host
DB_PORT = 3306 #port
DB_USER = 'root' #database login user
DB_PASSWORD = None #password
DB_NAME = 'name' #database
from mysqloop.mysqloop import mysqloop
import time
db = mysqloop()
# create table
createtable = db.table("user_name").create_table({
"id":"INTEGER PRIMARY KEY AUTOINCREMENT",
"name":"VARCHAR(80) NOT NULL"
})
print(createtable)
# create datas
insert = db.table("user_name").insert([{"name": "davie"}, {"name": "johan"}])
# create data
insert = db.table("user_name").create({"name": "davie"})
# delete
db.table("user_name").where("id",1).delete()
db.table("user_name").where("name","davie").delete()
# update
db.table("user_name").where("name","davie").updata({"name":"lisa"})
# select
db.table("user_name").where("name","<>","davie").limit(5).select("*")
# find
db.table("user_name").where("name","johan").find("*")
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
mysql-oop-0.1.6.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file mysql-oop-0.1.6.tar.gz
.
File metadata
- Download URL: mysql-oop-0.1.6.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e362cc314ebfa7d071adbbaff8f33a8e1eb613e4d87bb1f40b6eb2bbc7c0b612 |
|
MD5 | baf5568a8177f43bd6ada684b9fe9242 |
|
BLAKE2b-256 | 93517ae76d9d5c336368da23cfb3942326c2a686abb12ae96dc2ce195d4a610d |
File details
Details for the file mysql_oop-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: mysql_oop-0.1.6-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5be2c62d2219a778d865366e3bf13a0e2f3a2df8058e0732ddbd5c7caa6f475b |
|
MD5 | d59d740b941927739b671c4fde0ef09d |
|
BLAKE2b-256 | 72d30bb9b4bbcff469fe7dc623081de318b935b58ea65bce951c646eddaf5b02 |