Remove copyright headers from individual scripts
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / Storable.pm
CommitLineData
f6595170 1package SQL::Translator::Producer::Storable;
2
f6595170 3=head1 NAME
4
4fc11ff6 5SQL::Translator::Producer::Storable - serializes the SQL::Translator::Schema
6 object via the Storable module
f6595170 7
8=head1 SYNOPSIS
9
10 use SQL::Translator;
f6595170 11
12 my $translator = SQL::Translator->new;
4fc11ff6 13 $translator->producer('Storable');
f6595170 14
15=head1 DESCRIPTION
16
4fc11ff6 17This module uses Storable to serialize a schema to a string so that it
18can be saved to disk. Serializing a schema and then calling producers
19on the stored can realize significant performance gains when parsing
20takes a long time.
f6595170 21
22=cut
23
24use strict;
da06ac74 25use vars qw($DEBUG $VERSION @EXPORT_OK);
f6595170 26$DEBUG = 0 unless defined $DEBUG;
11ad2df9 27$VERSION = '1.59';
f6595170 28
29use Storable;
30use Exporter;
f6595170 31use base qw(Exporter);
32
33@EXPORT_OK = qw(produce);
34
35sub produce {
36 my $t = shift;
f6595170 37 my $args = $t->producer_args;
38 my $schema = $t->schema;
349af114 39 my $serialized = Storable::nfreeze($schema);
f6595170 40
41 return $serialized;
42}
43
441;
45
4fc11ff6 46# -------------------------------------------------------------------
47
f6595170 48=pod
49
4fc11ff6 50=head1 AUTHOR
f6595170 51
4fc11ff6 52Paul Harrington E<lt>harringp@deshaw.comE<gt>.
f6595170 53
54=head1 SEE ALSO
55
4fc11ff6 56SQL::Translator, SQL::Translator::Schema, Storable.
f6595170 57
58=cut