---
name: "DBIx::Class::Test::SQLite"
section: "3pm"
platform: "linux"
package: "libdbix-class-perl"
version: "0.08010-2"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/DBIx::Class::Test::SQLite"
---

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

DBIx::Class::Test::SQLite - Base class for running Class::DBI tests against DBIx::Class compat layer, shamelessly ripped from Class::DBI::Test::SQLite

```
  use base 'DBIx::Class::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 DBIx::Class::CDBICompat 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.\
 **set\_table**

```
    __PACKAGE__->set_table('test');
```

This combines creating the table with the normal DBIx::Class *table()* call.\
 **create\_sql** This is an abstract method you must override.

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