---
name: "Class::DBI::Test::SQLite"
section: "3pm"
platform: "linux"
package: "libclass-dbi-perl"
version: "3.0.17-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Class::DBI::Test::SQLite"
---

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

Base class for Class::DBI tests

## NAME

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

## SYNOPSIS

```
        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 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.
