As you can see the root XML tag is rdb having two attributes: connect and title for describing the DBAPI2 connect string and a title for the documentation respectively. There can be several query and statement tags. SQLFace will create a Query command object for the namespace cities that returns data after executing the expression, and a Statement command object for the namespace add_city to just execute the expression. The in and out tags are only present for generating documentation.

Coding

Initialize SQLFace

In order to use SQLFace you need to import a DBAPI2 compliant driver. In the examples psycopg2 is used as follows: