Using Django with a Postgres multi-schema backend

53 views
Skip to first unread message

Graham Fawcett

unread,
Feb 7, 2010, 5:55:42 PM2/7/10
to Art Rhyno, Robin Isard, syrup-reser...@googlegroups.com
Hi folks,

I've started a branch of Syrup that is able to communicate with a
Postgres database containing multiple schemas, such as an Evergreen
database:

http://svn.open-ils.org/trac/ILS-Contrib/changeset/768/servres/branches/eg-schema-experiment

The commit message details the work. In short, I'm now certain that we
can run Syrup in the context of a Postgres database, but without
losing the ability to run it in other contexts (e.g. a single-schema
Postgres database, or MySQL, or SQLite or Oracle).

The multi-schema backend code is not Evergreen specific; you could use
it to communicate with any other multi-schema Postgres database. The
'psycopg2' Python/Postgres adapter is required.

The commit I've linked to above includes a model based on Robin's
proposed schema; I created the Postgres database from his SQL file,
and used my new code to generate the Django model from the created
database.

Note, I'm not really *using* Robin's schema in this commit -- there is
no Web application that communicates with Robin's db. In fact, I'm
sure the Web interface is totally broken: this is just a demonstration
of the integration technique. Next steps are to discuss the two
database designs (Syrup's and Robin's) and figure out the best mix,
and then go ahead from there.

Best,
Graham

Reply all
Reply to author
Forward
0 new messages