I've had a play and I've gotten some tests passing for a simple implementation that makes what I wanted possible. Attached is a proof of concept tarball with code and tests.
I created a new Jifty::DBI::Handler, PgMultiSchema which is just a wrapper around the Pg handler. This intercepts the connect and dbh calls to set the correct schema based on an environment variable. This is not an ideal approach as it is Pg specific, but it does allow me to take advantage of the postgres schema setup. If we wanted to do something similar for other databases then it would just be a matter of creating Handlers for them that do this as well, or we make it part of the arguments to connect and each handler can do the right thing if possible. Please have a play and let me think if this is something that could make it's way into the core Jifty. Even if it does not it is nice to see that Jifty is flexible enough to allow this sort of modification without tinkering with the internals. Cheers, Edmund.
multi-schema.tgz
Description: GNU Zip compressed data
_______________________________________________ jifty-devel mailing list [email protected] http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
