File: BaseTest.pm

package info (click to toggle)
libsql-translator-perl 0.11011-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,380 kB
  • sloc: perl: 251,748; sql: 3,805; xml: 233; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Producer::BaseTest;

#
# A trivial little sub-class to test sub-classing the TT::Base producer.
#

use base qw/SQL::Translator::Producer::TT::Base/;

# Make sure we use our new class as the producer
sub produce { return __PACKAGE__->new( translator => shift )->run; };

# Note: we don't need to impliment tt_schema as the default will use the DATA
# section by default.

sub tt_vars { ( foo => "bar" ); }

sub tt_config { ( INTERPOLATE => 1 ); }

1;

__DATA__
Hello World
Tables: [% schema.get_tables.join(', ') %]
[% FOREACH table IN schema.get_tables -%]

$table
------
Fields: $table.field_names.join
[% END %]