1 package SQL::Translator::Parser::Storable;
3 # -------------------------------------------------------------------
4 # $Id: Storable.pm,v 1.5 2004-02-09 22:23:40 kycl4rk Exp $
5 # -------------------------------------------------------------------
6 # Copyright (C) 2002-4 SQLFairy Authors
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; version 2.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 # -------------------------------------------------------------------
25 SQL::Translator::Parser::Storable - parser for Schema objects serialized
26 with the Storable module
32 my $translator = SQL::Translator->new;
33 $translator->parser('Storable');
37 Slurps in a Schema from a Storable file on disk. You can then turn
38 the data into a database tables or graphs.
43 use vars qw($DEBUG $VERSION @EXPORT_OK);
44 $DEBUG = 0 unless defined $DEBUG;
45 $VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/;
49 use SQL::Translator::Utils qw(debug normalize_name);
51 use base qw(Exporter);
53 @EXPORT_OK = qw(parse);
56 my ($translator, $data) = @_;
59 $translator->{'schema'} = Storable::thaw($data);
61 } elsif (defined($translator->filename)) {
62 $translator->{'schema'} = Storable::retrieve($translator->filename);
71 # -------------------------------------------------------------------
81 Paul Harrington E<lt>harringp@deshaw.comE<gt>.