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
Class::DBI::Test::SQLite(3) User Contributed Perl Documentation Class::DBI::Test::SQLite(3)

Class::DBI::Test::SQLite - Base class for Class::DBI tests

        use base 'Class::DBI::Test::SQLite';

        __PACKAGE__->set_table('test');
        __PACKAGE__->columns(All => qw/id name film salary/);

        sub create_sql { 
                return q{
                        id     INTEGER PRIMARY KEY,
                        name   CHAR(40),
                        film   VARCHAR(255),
                        salary INT
                }
        }

This provides a simple base class for Class::DBI tests using SQLite. Each class for the test should inherit from this, provide a create_sql() method which returns a string representing the SQL used to create the table for the class, and then call set_table() to create the table, and tie it to the class.

        __PACKAGE__->set_table('test');

This combines creating the table with the normal Class::DBI table() call.

        sub create_sql { 
                return q{
                        id     INTEGER PRIMARY KEY,
                        name   CHAR(40),
                        film   VARCHAR(255),
                        salary INT
                }
        }

This should return, as a text string, the schema for the table represented by this class.

2005-05-24 perl v5.32.1

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

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