This page explains all the pieces required in order to implement an application that uses the Odyssey framework.
Each application has a source tree rooted at svn+ssh://odyssey@core.cs/u/odyssey/svn/odyssey/[application]
.
Within this directory, there is a directory trunk
containing the mainline of development on the application. There may be branches
and tags
directories as per Subversion (SVN) guidelines.
Within the trunk
directory there is an sql
directory containing SQL schema definitions and a python
directory containing Python code.
The Python code for each application follows typical Python packaging conventions. Typical subdirectories may include:
The whole directory is included as an SVN external in svn+ssh://odyssey@core.cs/u/odyssey/svn/odyssey/uwcode/trunk/python/uw/local
. This means that applications can access each others’ code by importing the appropriate Python module named uw.local.[application].…
.
The SQL schema definition for an application is broken up into a number of files. There is always an init.sql
file; executing this file as the appropriate Postgres user will create the schema corresponding to the application and assign appropriate role permissions, all within a transaction.
The init.sql
file in turn includes init_data.sql
, init_view.sql
, and init_perm.sql
. These are repsonsible for creating all objects in the schema:
init_data.sql
— Creates all tables (and sequences). In particular, the objects created here are the ones which, if dropped and re-created, will have lost something (in particular, the data stored in the tables; current value of sequences).
init_view.sql
— Creates all non-data-holding schema objects, including views and functions. The important distinction here is that these objects can be dropped and re-created in a working database without losing anything.
init_perm.sql
— Assigns all role permissions. Does not create the roles themselves; that is done manually.
-- IsaacMorland - 05 Nov 2008