Skip to main content

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


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

Uploaded Source

Built Distribution

mysql_oop-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file mysql-oop-0.1.0.tar.gz.

File metadata

  • Download URL: mysql-oop-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mysql-oop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 095872fe65fb34adad37b397254f76ed6b3b9fb6080041cea7cce7903a8932d4
MD5 e0aabdee36dab8a822882119a5e545c6
BLAKE2b-256 8df8762dcd3ecff0cc0595414313ba5f940c89fd8bc10d2bd0824eb668d0e459

See more details on using hashes here.

File details

Details for the file mysql_oop-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mysql_oop-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mysql_oop-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1973ce925f019707255de9e4a76e9373c894d5ea603f40c7fe369c4d0bf5948b
MD5 417c568310021973cb8646a199d090c9
BLAKE2b-256 47614686aeb79326a309e7fa6d4320b06db8d6783053bca5b3e0e210cd0a325d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page