Revision history for Perl extension DBIx::DBSchema.
-0.24 unreleased
+0.24 Fri Mar 11 02:20:55 PST 2005
- Oracle driver from Daniel Hanks <hanksdc@about-inc.com> and Peter
Bowen <pbowen@aboutws.com>.
- Switch from FreezeThaw to Storable, keep ability to read old files
#use Exporter;
use Carp qw(confess);
use DBI;
-use FreezeThaw qw(freeze thaw cmpStr);
+use Storable;
use DBIx::DBSchema::Table;
use DBIx::DBSchema::Column;
use DBIx::DBSchema::ColGroup::Unique;
#@ISA = qw(Exporter);
@ISA = ();
-$VERSION = "0.23";
+$VERSION = "0.24";
=head1 NAME
sub load {
my($proto,$file)=@_; #use $proto ?
- open(FILE,"<$file") or die "Can't open $file: $!";
- my($string)=join('',<FILE>); #can $string have newlines? pry not?
- close FILE or die "Can't close $file: $!";
- my($self)=thaw $string;
- #no bless needed?
+
+ my $self;
+
+ #first try Storable
+ eval { $self = Storable::retrieve($file); };
+
+ if ( $@ && $@ =~ /not.*storable/i ) { #then try FreezeThaw
+ eval "use FreezeThaw;";
+ die $@ if $@;
+ open(FILE,"<$file") or die "Can't open $file: $!";
+ my $string = join('',<FILE>);
+ close FILE or die "Can't close $file: $!";
+ ($self) = FreezeThaw::thaw($string);
+ }
+
$self;
+
}
=item save FILENAME
=cut
sub save {
- my($self,$file)=@_;
- my($string)=freeze $self;
- open(FILE,">$file") or die "Can't open $file: $!";
- print FILE $string;
- close FILE or die "Can't close file: $!";
- my($check_self)=thaw $string;
- die "Verify error: Can't freeze and thaw dbdef $self"
- if (cmpStr($self,$check_self));
+ #my($self, $file) = @_;
+ Storable::nstore(@_);
}
=item addtable TABLE_OBJECT
). " ],\n"
#" 'index' => [ ". " ],\n"
} $self->tables
- ), "}\n";
+ ). "}\n";
}
=cut
=head1 COPYRIGHT
-Copyright (c) 2000 Ivan Kohler
+Copyright (c) 2000-2005 Ivan Kohler
Copyright (c) 2000 Mail Abuse Prevention System LLC
All rights reserved.
This program is free software; you can redistribute it and/or modify it under
DBIx::DBSchema
-Copyright (c) 2000-2004 Ivan Kohler
+Copyright (c) 2000-2005 Ivan Kohler
Copyright (c) 2000 Mail Abuse Prevention System LLC
All rights reserved.
This program is free software; you can redistribute it and/or modify it under
it from different process. Most importantly, DBIx::DBSchema can write SQL
CREATE statements for different databases from a single source.
-Currently supported databases are MySQL, PostgreSQL, Sybase and Oracle.
+Currently supported databases are MySQL, PostgreSQL, Oracle and Sybase.
DBIx::DBSchema will attempt to use generic SQL syntax for other databases.
Assistance adding support for other databases is welcomed. See the
DBIx::DBSchema::DBD manpage, "Driver Writer's Guide and Base Class".
Homepage: <http://www.420.am/dbix-dbschema>
-$Id: README,v 1.10 2004-02-26 01:34:24 ivan Exp $
+$Id: README,v 1.11 2005-03-11 10:17:53 ivan Exp $