/[Frey]/trunk/lib/Strix/Schema.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/Strix/Schema.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53 - (show annotations)
Sat Jul 5 15:19:55 2008 UTC (15 years, 9 months ago) by dpavlin
File size: 786 byte(s)
huge wapping changes all over the place [0.05]

- begin move to Continuity::Widget instread of Template::Declare
- Frey::Introspection can now mock joose object with accessors
1 package Strix::Schema;
2
3 use Fey::DBIManager;
4 use Fey::DBIManager::Source;
5 use Fey::Loader;
6 use Fey::ORM::Schema;
7
8 use Storable;
9 use Data::Dump qw/dump/;
10 use URI::Escape;
11
12 my $dsn = 'dbi:Pg:dbname=new';
13 $dsn = 'dbi:SQLite:dbname=./var/strix.sqlite';
14
15 my $schema_file = 'var/schema.' . uri_escape( $dsn );
16
17 warn "Database $dsn schema cache $schema_file\n";
18
19 my $source = Fey::DBIManager::Source->new( dsn => $dsn );
20
21 my $schema;
22 if ( 0 ) { # FIXME
23 #if ( -e $schema_file ) {
24 $schema = retrieve $schema_file or die "can't read schema from $schema_file: $!";
25 } else {
26 $schema = Fey::Loader->new( dbh => $source->dbh() )->make_schema();
27 store $schema, $schema_file or warn "can't store schema into $schema_file: $!";
28 }
29
30 has_schema $schema;
31
32 __PACKAGE__->DBIManager()->add_source($source);

  ViewVC Help
Powered by ViewVC 1.1.26