1 package SQL::Translator::Parser::Storable;
3 # -------------------------------------------------------------------
4 # Copyright (C) 2002-2009 SQLFairy Authors
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; version 2.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 # -------------------------------------------------------------------
23 SQL::Translator::Parser::Storable - parser for Schema objects serialized
24 with the Storable module
30 my $translator = SQL::Translator->new;
31 $translator->parser('Storable');
35 Slurps in a Schema from a Storable file on disk. You can then turn
36 the data into a database tables or graphs.
41 use vars qw($DEBUG $VERSION @EXPORT_OK);
42 $DEBUG = 0 unless defined $DEBUG;
47 use SQL::Translator::Utils qw(debug normalize_name);
49 use base qw(Exporter);
51 @EXPORT_OK = qw(parse);
54 my ($translator, $data) = @_;
57 $translator->{'schema'} = Storable::thaw($data);
59 } elsif (defined($translator->filename)) {
60 $translator->{'schema'} = Storable::retrieve($translator->filename);
69 # -------------------------------------------------------------------
79 Paul Harrington E<lt>harringp@deshaw.comE<gt>.