we need a .gitignore file here
[p5sagit/Devel-REPL.git] / examples / dbic_project_profile.pl
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
5 Devel::REPL::Script->current->load_rcfile('repl.rc');
6
7 use lib 'lib'; # to get at the lib/Project.pm, lib/Project/* perl modules
8 use Project::Schema; # load the DBIC schema
9
10 Project::Schema->connection('dbi:Pg:dbname=project_matthewt_test','matthewt',''); # connect to db
11 Project::Schema->stacktrace(1); # turn on stack traces for DBI errors
12
13 sub schema { 'Project::Schema' } # shortcut so things like schema->sources works
14 sub rs { Project::Schema->resultset(shift); } # shortcut so rs('Foo')->find(1); works
15 sub cols { Project::Schema->source(shift)->columns; } # cols('Foo') returns a column list
16