/[SQLSession]/trunk/lib/SQLSession/Bootstrap.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/SQLSession/Bootstrap.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations)
Sat Dec 2 13:10:08 2006 UTC (17 years, 5 months ago) by dpavlin
File size: 576 byte(s)
bootstrap page data
1 use warnings;
2 use strict;
3
4 package SQLSession::Bootstrap;
5 use base qw(Jifty::Bootstrap);
6
7 =head1 Bootstrap application data
8
9 Create initial data
10
11 =cut
12
13 sub run {
14 my $self = shift;
15
16 my $system_user = SQLSession::CurrentUser->superuser( _bootstrap => 1 );
17
18 my $db = SQLSession::Model::Database->new(current_user => $system_user);
19 $db->create(
20 name => 'test',
21 dsn => 'DBI:Pg:dbname=test',
22 );
23
24 my $p = SQLSession::Model::Page->new(current_user => $system_user);
25 $p->create(
26 name => 'test query',
27 sql_query => 'select * from a;',
28 on_database => $db,
29 );
30
31 }
32
33 1;

  ViewVC Help
Powered by ViewVC 1.1.26