Vino

Vino Is Not ORM
Download

Vino Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Hsiaoming Yang
  • Publisher web site:
  • http://lepture.com/

Vino Tags


Vino Description

Vino is not ORM. Yes, it's true, it's not ORM.Get StartedA quick view with Vino:# setup# db = Vino('engine://user:passwd@host:port/database')db = Vino('sqlite://db.sqlite')# querydb.table('user').find(username='lepture').fetch()# createdb.table('user').create(username='lepture', website='http://lepture.com')db.commit()# updatedb.table('user').find(username='lepture').update(username='Hsiaoming Yang')db.commit()# deletedb.table('user').find(username='lepture').delete()db.commit()SetupWe will only support sqlite3 and mysql by now.SQLiteSQLite with relative path:db = Vino('sqlite://relative/path/db.sqlite')SQLite with absolute path:db = Vino('sqlite:///root/path/db.sqlite')Please note, it's different from SQLAlchemy.MySQLMySQL with all information:db = Vino('mysql://lepture:123456@localhost:3306/test')MySQL with less information:db = Vino('mysql://lepture@localhost/test')Default port is 3306.Please note, it's utf8 by default.QueryFind all data:db.table('user').fetch()Find all specified data:db.table('user').find(username='lepture').fetch()Find the first data:# fetch 1 will not return a listdb.table('user').find(username='lepture').fetch(1)Limit on query:db.table('user').find(username='lepture').fetch(5, offset=3)Multiple filters:db.table('user').find(username='lepture', age=20).fetch()Advanced filters:# just like Djangodb.table('user').find(age__in=).fetch()db.table('user').find(age__gt=20).fetch()db.table('user').find(age__lt=20).fetch()db.table('user').find(age__gte=20).fetch()db.table('user').find(age__lte=20).fetch()# more see documentationMore Advanced filters:db.table('user').find(age__ne=20).fetch() # not equaldb.table('user').find(age__nin=).fetch() # not in# more see documentationQuery order:db.table('user').find(age=20).order('-id').fetch()DeleteDelete all data:db.table('user').delete()db.commit()Delete specified data:db.table('user').find(username='lepture').delete()db.commit()Product's homepage


Vino Related Software