Useful Database Layer Package
Project description
#create a student
import greenapple
gco=greenapple.model.ConnectOperations()
gco.con.dbengine="MySQL"
gco.con.database="eshule"
gco.con.username="root"
gco.con.password="root"
student={"first_name":"'Alexandria'","last_name":"'Nandyose'","table":"student","clause":"where id = 4"}
student["last_name"]="'Marvin Stevens'"
gco.insert(student)
dataset=gco.select_dataset({"table":"student","clause":"where id=8"})
for record in dataset:
print record
Postgresql Example
import greenapple
gco=greenapple.model.ConnectOperations()
gco.con.dbengine="PSQL"
gco.con.database="eshule"
gco.con.username="root"
gco.con.password="root"
student={"first_name":"'Emmaculate'","last_name":"'Akongo'","table":"student"}
gco.insert(student)
student["last_name"]="'Opata'"
student["clause"]="where id =1";
gco.update(student)
dataset=gco.select_dataset({"table":"student"})
for record in dataset:
print record
import greenapple
gco=greenapple.model.ConnectOperations()
gco.con.dbengine="MySQL"
gco.con.database="eshule"
gco.con.username="root"
gco.con.password="root"
student={"first_name":"'Alexandria'","last_name":"'Nandyose'","table":"student","clause":"where id = 4"}
student["last_name"]="'Marvin Stevens'"
gco.insert(student)
dataset=gco.select_dataset({"table":"student","clause":"where id=8"})
for record in dataset:
print record
Postgresql Example
import greenapple
gco=greenapple.model.ConnectOperations()
gco.con.dbengine="PSQL"
gco.con.database="eshule"
gco.con.username="root"
gco.con.password="root"
student={"first_name":"'Emmaculate'","last_name":"'Akongo'","table":"student"}
gco.insert(student)
student["last_name"]="'Opata'"
student["clause"]="where id =1";
gco.update(student)
dataset=gco.select_dataset({"table":"student"})
for record in dataset:
print record
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
greenapple-0.1.2.tar.gz
(3.2 kB
view details)
File details
Details for the file greenapple-0.1.2.tar.gz
.
File metadata
- Download URL: greenapple-0.1.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 548389e4e090fe4819e4af6338a45685a545134141e2686202e36ddd69e28a5a |
|
MD5 | 6b1c46938d6c19e489a3c05e69451346 |
|
BLAKE2b-256 | 64bda7e15ed07132a9b8973468796ce998535a7c0adfa84643de1453fdd9b989 |