Class::DBI::Test::SQLite(3pm)

Class::DBI::Test::SQLite3pm

Base class for class::dbi tests

Usage

        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
                }
        }

Overview

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.

Methods

set_table

        __PACKAGE__->set_table('test');

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

create_sql (abstract)

        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.

Releases

10 releases since Debian 4.0 (Etch); the text changed 5 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7–10
  5. 11
  6. 12–13

From libclass-dbi-perl 3.0.17-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.