commit the TODO list
[p5sagit/Devel-REPL.git] / examples / dbic_project_profile.pl
CommitLineData
6aa58492 1# this might live in /path/to/checkout/.re.pl/project.rc
2# see: http://chainsawblues.vox.com/library/post/develrepl-part-4---script-options-rc-files-profiles-and-packaging.html
3
4# load my global ~/.re.pl/repl.rc
5Devel::REPL::Script->current->load_rcfile('repl.rc');
6
7use lib 'lib'; # to get at the lib/Project.pm, lib/Project/* perl modules
8use Project::Schema; # load the DBIC schema
9
10Project::Schema->connection('dbi:Pg:dbname=project_matthewt_test','matthewt',''); # connect to db
11Project::Schema->stacktrace(1); # turn on stack traces for DBI errors
12
13sub schema { 'Project::Schema' } # shortcut so things like schema->sources works
14sub rs { Project::Schema->resultset(shift); } # shortcut so rs('Foo')->find(1); works
15sub cols { Project::Schema->source(shift)->columns; } # cols('Foo') returns a column list
16