NAME

DBIO::SQLite::Test - SQLite-specific test utilities for DBIO

VERSION

version 0.900007

SYNOPSIS

use DBIO::SQLite::Test;

# In-memory schema (most tests)
my $schema = DBIO::SQLite::Test->init_schema;

# File-based schema (for reconnect/persistence tests)
my $schema = DBIO::SQLite::Test->init_schema(sqlite_use_file => 1);

# Shared driver test through replicated storage
my $replicated = DBIO::SQLite::Test->init_schema(
  replicated   => 1,
  storage_type => 'DBIO::SQLite::Storage',
);

DESCRIPTION

Extends DBIO::Test with SQLite-specific test helpers for the DBIO::SQLite driver distribution.

METHODS

_sqlite_dbfilename

Returns the path to the file-based test SQLite database.

_sqlite_dbname

Returns the database name — either a file path or :memory:.

_database

Returns a list of ($dsn, $user, $pass, \%opts) suitable for $schema->connect().

The arguments are those of "init_schema". The ones that steer the helper itself (no_deploy, no_populate, storage_type, sqlite_use_file, ...) are consumed here and left out of the connect attributes; everything else (quote_names, auto_savepoint, on_connect_do, AutoCommit, DBI attributes) is passed on to the connection.

init_schema

my $schema = DBIO::SQLite::Test->init_schema(%opts);

Wrapper around "init_schema" in DBIO::Test that defaults to an in-memory SQLite database.

Supports all "init_schema" in DBIO::Test options plus:

sqlite_use_file

Use a file-based SQLite database instead of :memory:.

The schema declares DBIO::SQLite::Storage as its driver unless storage_type names another storage class: a schema always has a driver (core ADR 0067), and DBIO::Test::Schema keeps none in its class.

Shared DBIO::Test options such as replicated => 1 are normalized before the SQLite-specific connection is built, so driver tests can opt into replicated coverage without rebuilding their schema setup. The master and every replicant are storages of the declared driver: the helper passes it on as backend_storage_class, unless a full replicated storage_type gives one itself.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.