sqldict - dict with sqlalchemy database-agnostic back-end
Project description
sqldict - dict with sqlalchemy database-agnostic backend
Usage:
from sqldict import sqldict
d = sqldict(dburi="mysql://user:pass@localhost/dbname",
tablename="hoho",
create=1)
d["asd"] = 123
for key,val in d.iteritems():
assert d["asd"] == 123
from sqlalchemy import *
engine = create_engine('sqlite://')
conn = engine.connect()
d2 = sqldict(engine=engine, tablename='hihi')
d3 = sqldict(conn=conn, tablename='haha')
d4 = sqldict(conn=conn, tablename='nstest', ns='A')
d5 = sqldict(conn=conn, tablename='nstest', ns='B')
assert d4.namespaces() == ["A", "B"]
Usage:
from sqldict import sqldict
d = sqldict(dburi="mysql://user:pass@localhost/dbname",
tablename="hoho",
create=1)
d["asd"] = 123
for key,val in d.iteritems():
assert d["asd"] == 123
from sqlalchemy import *
engine = create_engine('sqlite://')
conn = engine.connect()
d2 = sqldict(engine=engine, tablename='hihi')
d3 = sqldict(conn=conn, tablename='haha')
d4 = sqldict(conn=conn, tablename='nstest', ns='A')
d5 = sqldict(conn=conn, tablename='nstest', ns='B')
assert d4.namespaces() == ["A", "B"]
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
sqldict-0.3.1.tar.gz
(4.3 kB
view hashes)