[jifty-devel] Re: Data partitioning (ie multiple databases)

Edmund von der Burg evdb at ecclestoad.co.uk
Mon Jan 8 14:54:45 EST 2007


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multi-schema.tgz
Type: application/x-gzip
Size: 1576 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070108/5fbaaf5e/multi-schema.bin


More information about the jifty-devel mailing list