# Class::DBI::Test::SQLite - Base class for Class::DBI tests - man(3pm) - [phpMan]

## NAME
    [Class::DBI::Test::SQLite](https://www.chedong.com/phpMan.php/perldoc/Class%3A%3ADBI%3A%3ATest%3A%3ASQLite/markdown) - Base class for [Class::DBI](https://www.chedong.com/phpMan.php/perldoc/Class%3A%3ADBI/markdown) tests

## SYNOPSIS
            use base '[Class::DBI::Test::SQLite](https://www.chedong.com/phpMan.php/perldoc/Class%3A%3ADBI%3A%3ATest%3A%3ASQLite/markdown)';

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

            sub create_sql {
                    return q{
                            id     INTEGER PRIMARY KEY,
                            name   [CHAR(40)](https://www.chedong.com/phpMan.php/man/CHAR/40/markdown),
                            film   [VARCHAR(255)](https://www.chedong.com/phpMan.php/man/VARCHAR/255/markdown),
                            salary INT
                    }
            }

## DESCRIPTION
    This provides a simple base class for [Class::DBI](https://www.chedong.com/phpMan.php/perldoc/Class%3A%3ADBI/markdown) 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](https://www.chedong.com/phpMan.php/perldoc/Class%3A%3ADBI/markdown) table() call.

  create_sql (abstract)
            sub create_sql {
                    return q{
                            id     INTEGER PRIMARY KEY,
                            name   [CHAR(40)](https://www.chedong.com/phpMan.php/man/CHAR/40/markdown),
                            film   [VARCHAR(255)](https://www.chedong.com/phpMan.php/man/VARCHAR/255/markdown),
                            salary INT
                    }
            }

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

