1 package SQL::Translator::Producer::Storable;
3 # -------------------------------------------------------------------
4 # $Id: Storable.pm,v 1.4 2003-10-15 19:13:23 kycl4rk Exp $
5 # -------------------------------------------------------------------
6 # Copyright (C) 2003 Paul Harrington <harringp@deshaw.com>.
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 # -------------------------------------------------------------------
24 SQL::Translator::Producer::Storable - serializes the SQL::Translator::Schema
25 object via the Storable module
31 my $translator = SQL::Translator->new;
32 $translator->producer('Storable');
36 This module uses Storable to serialize a schema to a string so that it
37 can be saved to disk. Serializing a schema and then calling producers
38 on the stored can realize significant performance gains when parsing
44 use vars qw($DEBUG $VERSION @EXPORT_OK);
45 $DEBUG = 0 unless defined $DEBUG;
46 $VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/;
50 use base qw(Exporter);
52 @EXPORT_OK = qw(produce);
56 my $args = $t->producer_args;
57 my $schema = $t->schema;
58 my $serialized = Storable::nfreeze($schema);
65 # -------------------------------------------------------------------
71 Paul Harrington E<lt>harringp@deshaw.comE<gt>.
75 SQL::Translator, SQL::Translator::Schema, Storable.