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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mysql-oop-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 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.2.tar.gz
Algorithm Hash digest
SHA256 8d368fe989044acbcb04b110eca39bdfd10fef753b1ea3ed408bf26fbab97ece
MD5 9cb22be34b694909efa5e6d67b4808a0
BLAKE2b-256 40bf53e53a475d5cac2d7bf653a6ef4c7854d2264516fd9163214824245c03ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysql_oop-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c31074f21ef3b75529b495c8a924cb1ed72a4691db20c8a11cab63689f3013d
MD5 e29a3152e03e52a60ef7cb9f02448c7c
BLAKE2b-256 0c384ad68fe885bfad3134f85495edc40e2debf745d2a0b1009e3613818b67d1

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