[Dbix-class] Local DB Mirror

fREW Schmidt frioux at gmail.com
Tue Jul 21 03:19:53 GMT 2009


On Mon, Jul 20, 2009 at 10:10 PM, Ashley <apv at sedition.com> wrote:

> On Jul 20, 2009, at 7:52 PM, fREW Schmidt wrote:
>
>> Very interesting!  How did you generate the table structure for the SQLi=
te
>> 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 f=
rom
> 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/track=
er
> | 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.
>

Interesting.  I assumed that might be how you pull it off.  Our models don't
have any column type information, but I doubt that will be an issue since
everything in SQLite is just TEXT or BLOB or whatever.  One last question.
Did you dump the SQL statements with perl or MySQL?

-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20090720/c3d=
11c21/attachment.htm


More information about the DBIx-Class mailing list