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

Uploaded Source

Built Distribution

mysql_oop-0.1.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mysql-oop-0.1.3.tar.gz
  • Upload date:
  • Size: 6.6 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.3.tar.gz
Algorithm Hash digest
SHA256 198a4980cc4c83b2bf3743002eb2a27984aac806f6ad230d0ad8c19fd66bbfff
MD5 08f1b0f3b6e4242219d29e44f76b2bfc
BLAKE2b-256 36b290d4c4d0076cb92fccfc00ede77a1b119066936bdb20251172d057074dba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysql_oop-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6393b5789a451b558fcc3857b6432276df2fc35a6a1bd77274346d6873e16c9a
MD5 572b149af678d9f2bab6b0fd9c691629
BLAKE2b-256 a7583ed523691b2b52f3ba833eecea3bf321a9a3f7f4a18f28a4fe7bd0be7c2e

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