A pure-Python in-memory database engine
Project description
PyDbLite is a pure-Python in-memory database engine, using Python list comprehensions as query language, instead of SQL
It consists of one small module, PyDbLite.py. The package also provides two modules, SQLite.py and MySQL.py. They use SQLite and MySQL backends with the same Pythonic syntax as the pure-Python PyDbLite engine
Quick example :
from PyDbLite import Base
db = Base(‘dummy’)
db.create(‘name’,’age’,’size’)
db.insert(name=’homer’,age=23,size=1.84)
db.commit()
recs = [ r for r in db if 30 > r[‘age’] >= 18 and r[‘size’] < 2 ]
recs = db(key1=val1,key2=val2)
db.update(record,age=24)
db.delete(record)