About
A simple and lightweight ORM that facilitate some operations on MySQL using of pymysql.
How to use
Preparation
# Single call it once to setup the inner settings
BetterMYSQL.setup("name of the database", "db user", "db password", "host", 1234) #port
# Creating a DB Model
class Fruits():
_table = "fruit_table_name"
class People():
_table = "people_table_name"
Select
# Select the first fruit ordered by name and retrieve the first row
Fruits().select("name").order("name").row() # returns one row
# Select all data from the top 15 fruits
Fruits().select("*").limit("15").run() # returns a row list
# Select all data from the top 15 fruits
Fruits().select("*").limit("15").run() # returns a row list
# Select the name of the first person with 34 years old
People().select("name").where("age = ?").cell(34) # returns the first cell of the first row
Insert
# Inserting a person given its name and age
People().insert("name, age").run(["Matt", 34])
Update
# Updating all ages to 16 where the name is Matt
People().update("age = ?").where("name = ?").run([16, "Matt"])
Delete
# Delete all people
People().delete()
Release files for bettermysql 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bettermysql-0.0.5.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bettermysql-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / bettermysql-0.0.5.tar.gz
| Download URL | bettermysql-0.0.5.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
342a2a6d392039e4b354dfdd567ccd188faea0dde71866526b6bbeffe0d38822
|
|
BLAKE2b-256 checksum How to use checksums |
6523c09cb15a9b876cd0e97ca68c2e9231d6a8ed5dd9c8c158ff3f7043f67d9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.18
|
Release files / bettermysql-0.0.5-py3-none-any.whl
| Download URL | bettermysql-0.0.5-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b21776e5969c388a45bbb4c68e175e71ab8bd530ac6ff93cfdec9020fab9a546
|
|
BLAKE2b-256 checksum How to use checksums |
e0f86f6f2fb96464a116f42227ace689156234988aeb6c0c6218ad1420ea1216
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.18
|