My favorites | Sign in
Project Logo
                
Code license: MIT License
Labels: sql, python
Show all Featured wiki pages:
news
Feeds:
People details
Project owners:
  mpietrzak

Makes writing portable database applications easier.

Instead of writing your own database access layer that imports psycopg, psycopg2, cx_Oracle or other database access library, one can now import anysql and specify database driver as a connection method parameter.

If SQL you write is close to standards and specifications, you can switch database backends easily.

Most important feature is the unification of paramstyle interface.

Widely known library of similar functionality seems to be ADOdb (which has been written for PHP initially, but has been ported to Python to). However, ADOdb doesn't hide module's paramstyle.

Example code:

conn = anysql.connect('postgresql', database='foo', username='bar')
curs = conn.cursor()
curs.execute('select current_timestamp')
print curs.fetchall()
curs.execute('select bar from foo where baz = $id', {'id': 1})
print curs.fetchall()








Hosted by Google Code