# man > Class::DBI::Test::SQLite

---
type: CommandReference
command: Class::DBI::Test::SQLite
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference

- `use base 'Class::DBI::Test::SQLite'` — Inherit from this base class for tests.
- `__PACKAGE__->set_table('table_name')` — Create table and tie to class.
- `sub create_sql { ... }` — Define table schema as SQL string.

## Name

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

## Synopsis

perl
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
    };
}
## Description

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

## Methods

### `set_table`

perl
__PACKAGE__->set_table('test');
Combines creating the table with the normal Class::DBI `table()` call.

### `create_sql` (abstract)

perl
sub create_sql {
    return q{
        id     INTEGER PRIMARY KEY,
        name   CHAR(40),
        film   VARCHAR(255),
        salary INT
    };
}
Returns the schema for the table as a text string.

## See Also

- [Class::DBI::Test](perldoc://Class::DBI::Test)
- [Class::DBI](perldoc://Class::DBI)