on sqlite, mysql, postgresql, and Oracle
[edit|delete]Web2py binary distributions (for windows and mac) come packaged with python 2.5 which includes SQLIte3.
For legal reasons we do not distribute the drivers for MySQL, PostgreSQL and Oracle. In order to use these databases you need to run web2py from source, i.e.:
- install Python 2.5
- install mysqldb (for MySQL), psycopg2 (for PostgreSQL), and/or cx_oracle (for Oracle)
- download the web2py source
run with
python2.5 web2py.py
moreover in your model you need to substitute the connection string
db=SQLDB('sqlite://filename.db')
with (for MySQL)
db=SQLDB('mysql://username:password@hostname:port/dbname')
or (for PostgreSQL)
db=SQLDB('postgres://username:password@hostname:port/dbname')
or (for Oracle)
db=SQLDB('oracle://username:password@dbname')
All those database backends in web2py support automatic transactions (for mysql we use InnoDB): commit on return, rollback on exception.
We are working on mssql and db2 connectivity. If you can help with testing please contact us.
For a serious, scalable, production quality, modern database back-end we recommend PostgreSQL. That's what we run and we have stress-tested it quite extensively.