selenamarie is
2008-06-12T02:15:54.000Z
at DBIx::Class meeting with perlmongers!
latest #46
selenamarie says
2008-06-12T02:18:46.000Z
we're going to have charcoal colored shirts.
selenamarie says
2008-06-12T02:19:12.000Z
i asked for sparkles for color, but might not happen.
selenamarie says
2008-06-12T02:21:26.000Z
schwern brought donuts!
立即下載
selenamarie says
2008-06-12T02:24:36.000Z
i said i would improve on SQL by eliminating NULLS
selenamarie says
2008-06-12T02:26:44.000Z
someone pitched samy.pl/sql++/
selenamarie says
2008-06-12T02:27:15.000Z
selenamarie says
2008-06-12T02:27:24.000Z
(that's the URL Jay is referencing)
selenamarie says
2008-06-12T02:27:35.000Z
we just started the podcast, so time to say naughty things!
selenamarie says
2008-06-12T02:31:39.000Z
object: is a group of columns, (a table), that has indexes
selenamarie says
2008-06-12T02:32:20.000Z
BEER is our example: beer has many distributors, with a brewer, and a name!
selenamarie says
2008-06-12T02:33:04.000Z
can add indexes add_unique_indexes()
selenamarie says
2008-06-12T02:34:08.000Z
belongs_to is the opposite end of has_many
selenamarie says
2008-06-12T02:34:23.000Z
has_one, might_have means that, and many_to_many is pretty complicated
selenamarie says
2008-06-12T02:36:56.000Z
create $schema from the Beer::Schema, and then ->connect($dsn) just like Class::-DBI
selenamarie says
2008-06-12T02:37:16.000Z
err. Class:\:-DBI
selenamarie says
2008-06-12T02:37:48.000Z
"Chained Result Sets are what DBIC Great"
selenamarie wishes
2008-06-12T02:38:33.000Z
the code was bigger :-)
selenamarie says
2008-06-12T02:41:08.000Z
create_ddl_dir() creates table statements
selenamarie says
2008-06-12T02:41:48.000Z
$schema->deploy() - creates database for you!
selenamarie says
2008-06-12T02:42:14.000Z
now for the tests!
selenamarie says
2008-06-12T02:44:46.000Z
the big thing to understand going from Class::-DBI to DBIx::Class
selenamarie says
2008-06-12T02:44:59.000Z
is that everything from DBIx::Class is a Result Set!
selenamarie says
2008-06-12T02:46:46.000Z
in the top level Schema - lots of ppl put in an init_schema() function to parse YAML, set things up, etc.
selenamarie says
2008-06-12T02:47:36.000Z
this results in much shorter tests! (testing with SQLite, instead of DB Brand X)
selenamarie says
2008-06-12T02:48:17.000Z
live debugging!
selenamarie says
2008-06-12T02:51:51.000Z
showing some code examples using beer from YAPC Asia
selenamarie says
2008-06-12T02:55:58.000Z
(g_doh)
selenamarie says
2008-06-12T02:57:14.000Z
thx for the fix!
selenamarie says
2008-06-12T02:57:39.000Z
DBIx::Class will create the foreign key refs automatically
selenamarie says
2008-06-12T03:01:14.000Z
there were some weird things -- i think the more interesting case is what cheeseinspector did at PDXPUG
selenamarie says
2008-06-12T03:01:29.000Z
where you're taking an ORM and modeling a DB that already exists. i think that's much harder.
selenamarie says
2008-06-12T03:06:22.000Z
DBIx::Class::QueryLog::Analyzer - useful for debugging!
selenamarie says
2008-06-12T03:09:00.000Z
caching q: example of an attribute held in the object, versus pulling from the DB - you can force a recall at any point.
selenamarie says
2008-06-12T03:09:16.000Z
jay recommends doing everything in a transaction.
selenamarie says
2008-06-12T03:09:30.000Z
$schema->txn_do( blah blah );
selenamarie says
2008-06-12T03:14:12.000Z
(that's how to do a transaction)
selenamarie says
2008-06-12T03:15:15.000Z
DBIx::Class::Schema::Loader
selenamarie says
2008-06-12T03:17:20.000Z
one liner from the docs:
selenamarie says
2008-06-12T03:17:29.000Z
perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib \
selenamarie says
2008-06-12T03:17:31.000Z
-e 'make_schema_at("My::Schema", { debug => 1 }, [ "dbi:-Pg:dbname=foo","postgres" ])'
selenamarie says
2008-06-12T03:18:19.000Z
try Carp::REPL - read-eval-print-loop on die and or warn
selenamarie says
2008-06-12T03:19:30.000Z
time for practical beer!
back to top