Bumping version to 1.61
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / Storable.pm
CommitLineData
f6595170 1package SQL::Translator::Producer::Storable;
2
f6595170 3=head1 NAME
4
df399712 5SQL::Translator::Producer::Storable - serializes the SQL::Translator::Schema
4fc11ff6 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;
f27f9229 25use warnings;
0c04c5a2 26our ( $DEBUG, @EXPORT_OK );
f6595170 27$DEBUG = 0 unless defined $DEBUG;
752a0ffc 28our $VERSION = '1.61';
f6595170 29
30use Storable;
31use Exporter;
f6595170 32use base qw(Exporter);
33
34@EXPORT_OK = qw(produce);
35
36sub produce {
37 my $t = shift;
f6595170 38 my $args = $t->producer_args;
39 my $schema = $t->schema;
349af114 40 my $serialized = Storable::nfreeze($schema);
f6595170 41
42 return $serialized;
43}
44
451;
46
47=pod
48
4fc11ff6 49=head1 AUTHOR
f6595170 50
4fc11ff6 51Paul Harrington E<lt>harringp@deshaw.comE<gt>.
f6595170 52
53=head1 SEE ALSO
54
4fc11ff6 55SQL::Translator, SQL::Translator::Schema, Storable.
f6595170 56
57=cut