1 package SQL::Translator::Producer::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 # -------------------------------------------------------------------
22 SQL::Translator::Producer::Storable - serializes the SQL::Translator::Schema
23 object via the Storable module
29 my $translator = SQL::Translator->new;
30 $translator->producer('Storable');
34 This module uses Storable to serialize a schema to a string so that it
35 can be saved to disk. Serializing a schema and then calling producers
36 on the stored can realize significant performance gains when parsing
42 use vars qw($DEBUG $VERSION @EXPORT_OK);
43 $DEBUG = 0 unless defined $DEBUG;
48 use base qw(Exporter);
50 @EXPORT_OK = qw(produce);
54 my $args = $t->producer_args;
55 my $schema = $t->schema;
56 my $serialized = Storable::nfreeze($schema);
63 # -------------------------------------------------------------------
69 Paul Harrington E<lt>harringp@deshaw.comE<gt>.
73 SQL::Translator, SQL::Translator::Schema, Storable.