[Dbix-class] Local DB Mirror
Ashley
apv at sedition.com
Tue Jul 21 03:10:02 GMT 2009
On Jul 20, 2009, at 7:52 PM, fREW Schmidt wrote:
> Very interesting! How did you generate the table structure for the
> SQLite database?
Check out http://search.cpan.org/perldoc?
DBIx::Class::Manual::Cookbook and any mention of the method "deploy"
in the docs and list archive. DBIC::Schema will try to deploy your
database (perhaps just from classes) anywhere you define. SQLite
rules for this and allows, for example, destructive or dangerous
tests: deleting users, creating orders, etc to be run against a real
test DB and not just mocked.
I'm writing a series of articles about different models in Catalyst.
Tomorrow's, coincidentally, is the first in DBIC and does this
deployment thing but not for tests, for creating a tracking database
for a web app from a schema. This will be the link when it's live
sometime tomorrow (I haven't picked a time for this one because I'm
cleaning it up still but I've been doing them around midnight) --
Catalyst Model #7: Page view counter/tracker | http://sedition.com/a/
2740 -- it will get a "410: Gone" until its publish time rolls around
tonight/tomorrow. The example code may be confusing because it's
wrapped in some Catalyst, the db auto-deploys from a controller if
it's not found on the first try to use it.
Still, I think deploy is a really hot feature and I'm so glad it's
become more mature/stable lately along with the pieces it relies on
like SQL::Translator; the folks who work on those rule. Check out
DBIx::Class::Fixtures too. Chocolate and peanut-butter.
-Ashley
More information about the DBIx-Class
mailing list