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

Uploaded Source

Built Distribution

mysql_oop-0.1.5-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mysql-oop-0.1.5.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

Hashes for mysql-oop-0.1.5.tar.gz
Algorithm Hash digest
SHA256 df059e13ff00ccdb7bdc5a5e3e4b9587c8fc5a7473a6d3e475f99942333512e4
MD5 b9c4130181dd88fd9b5be56cc8b57e50
BLAKE2b-256 f458637c0aa6db72116121d278e81396437bc80c11c1058897f2696bcf889472

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mysql_oop-0.1.5-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

Hashes for mysql_oop-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 907068ef5b7741be617ab33296f100a25eb9492285146d2affa72357b6d9c641
MD5 2274eb2e3a7cce28c63588e63b92451f
BLAKE2b-256 438464f3b5835f35c08710714b8a84587df4cb431f41e0edc12ce41c549844d1

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