GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TENG::SCHEMA::DUMPER (3)

.ds Aq ’

NAME

Teng::Schema::Dumper - Schema code generator

CONTENTS

SYNOPSIS



    use DBI;
    use Teng::Schema::Dumper;

    my $dbh = DBI->connect(@dsn) or die;
    print Teng::Schema::Dumper->dump(
        dbh       => $dbh,
        namespace => Mock::DB,
        inflate   => +{
            user => q|
                use Mock::Inflate::Name;
                inflate name => sub {
                    my ($col_value) = @_;
                    return Mock::Inflate::Name->new(name => $col_value);
                };
                deflate name => sub {
                    my ($col_value) = @_;
                    return ref $col_value ? $col_value->name : $col_value . _deflate;
                };
                inflate qr/.+oo/ => sub {
                    my ($col_value) = @_;
                    return Mock::Inflate::Name->new(name => $col_value);
                };
                deflate qr/.+oo/ => sub {
                    my ($col_value) = @_;
                    return ref $col_value ? $col_value->name : $col_value . _deflate;
                };
            |,
        },
    );



DESCRIPTION

This module generates the Perl code to generate Teng::Schema instance.

You can use it by do "my/schema.pl" or embed it to the package.

METHODS

Teng::Schema::Dumper->dump(dbh => $dbh, namespace => $namespace) This is the method to generate code from DB. It returns the Perl5 code in string.

The arguments are:
dbh Database handle from DBI.
namespace your project Teng namespace.
base_row_class Specify the default base row class for Teng::Schema::Declare.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TENG::SCHEMA::DUMPER (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.