lib/SQL/Translator/Parser/MySQL.pm
lib/SQL/Translator/Parser/Oracle.pm
lib/SQL/Translator/Parser/PostgreSQL.pm
+lib/SQL/Translator/Parser/Storable.pm
lib/SQL/Translator/Parser/Sybase.pm
lib/SQL/Translator/Parser/xSV.pm
lib/SQL/Translator/Parser/XML.pm
lib/SQL/Translator/Producer/HTML.pm
lib/SQL/Translator/Producer/MySQL.pm
lib/SQL/Translator/Producer/Oracle.pm
-lib/SQL/Translator/Producer/POD.pm
lib/SQL/Translator/Producer/PostgreSQL.pm
lib/SQL/Translator/Producer/SQLite.pm
+lib/SQL/Translator/Producer/Storable.pm
lib/SQL/Translator/Producer/Sybase.pm
lib/SQL/Translator/Producer/TTSchema.pm
lib/SQL/Translator/Producer/YAML.pm
t/18ttschema-producer.t
t/21xml-xmi-parser.t
t/24yaml.t
+t/25storable.t
+t/26sybase-dbi.t
t/data/Excel/t.xls
t/data/mysql/Apache-Session-MySQL.sql
t/data/mysql/BGEP-RE-create.sql
--- /dev/null
+package SQL::Translator::Parser::Storable;
+
+# $Source: /home/faga/work/sqlfairy_svn/sqlfairy-cvsbackup/sqlfairy/lib/SQL/Translator/Parser/Storable.pm,v $
+# $Id: Storable.pm,v 1.1 2003-10-08 18:24:25 phrrngtn Exp $
+
+=head1 NAME
+
+SQL::Translator::Parser::Storable - null parser for Schema objects that have already been created.
+
+=head1 SYNOPSIS
+
+ use SQL::Translator;
+ use SQL::Translator::Parser::Storable;
+
+ my $translator = SQL::Translator->new;
+ $translator->parser("SQL::Translator::Parser::Storable");
+
+=head1 DESCRIPTION
+
+Slurps in a Schema from a Storable file on disk. You can then turn
+the data into a database tables or graphs.
+
+=cut
+
+use strict;
+use vars qw($DEBUG $VERSION @EXPORT_OK);
+$DEBUG = 0 unless defined $DEBUG;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/;
+
+use Storable;
+use Exporter;
+use SQL::Translator::Utils qw(debug normalize_name);
+
+use base qw(Exporter);
+
+@EXPORT_OK = qw(parse);
+
+sub parse {
+ my ($translator, $data) = @_;
+
+ $translator->{'schema'} = Storable::thaw($data)
+ if defined($data);
+
+ $translator->{'schema'} = Storable::retrieve($translator->filename)
+ if defined($translator->filename);
+
+ return 1;
+}
+
+1;
+
+=pod
+
+=head1 SEE ALSO
+
+SQL::Translator::Parser::Excel;
+
+=head1 AUTHORS
+
+Paul Harrington <harringp@deshaw.com>
+
+=cut
--- /dev/null
+package SQL::Translator::Producer::Storable;
+
+# $Source: /home/faga/work/sqlfairy_svn/sqlfairy-cvsbackup/sqlfairy/lib/SQL/Translator/Producer/Storable.pm,v $
+# $Id: Storable.pm,v 1.1 2003-10-08 18:24:25 phrrngtn Exp $
+
+=head1 NAME
+
+SQL::Translator::Producer::Storable - null producer for Schema objects that have already been created.
+
+=head1 SYNOPSIS
+
+ use SQL::Translator;
+ use SQL::Translator::Producer::Storable;
+
+ my $translator = SQL::Translator->new;
+ $translator->producer("SQL::Translator::Producer::Storable");
+
+=head1 DESCRIPTION
+
+Uses Storable to serialize a schema to a string so that it can be
+saved on disk or whatever.
+
+=cut
+
+use strict;
+use vars qw($DEBUG $VERSION @EXPORT_OK);
+$DEBUG = 0 unless defined $DEBUG;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/;
+
+use Storable;
+use Exporter;
+use SQL::Translator::Utils qw(debug normalize_name);
+
+use base qw(Exporter);
+
+@EXPORT_OK = qw(produce);
+
+sub produce {
+ my $t = shift;
+
+ my $args = $t->producer_args;
+ my $schema = $t->schema;
+ my $serialized = Storable::freeze($schema);
+
+ return $serialized;
+}
+
+1;
+
+=pod
+
+=head1 AUTHORS
+
+Paul Harrington <harringp@deshaw.com>
+
+=head1 SEE ALSO
+
+SQL::Translator::Parser::Excel;
+
+=cut
--- /dev/null
+#!/usr/local/bin/perl
+# vim: set ft=perl:
+
+# $Source: /home/faga/work/sqlfairy_svn/sqlfairy-cvsbackup/sqlfairy/t/25storable.t,v $
+# $Id: 25storable.t,v 1.1 2003-10-08 18:24:24 phrrngtn Exp $
+
+use Test::More tests => 2;
+
+use_ok('SQL::Translator::Parser::Storable');
+use_ok('SQL::Translator::Producer::Storable');
+
+1;
+