NAME
DBIO::SQLite::Test::Conformance - Answers the shared conformance case table for the SQLite driver
VERSION
version 0.900007
SYNOPSIS
use DBIO::SQLite::Test::Conformance;
DBIO::SQLite::Test::Conformance->run('DDL');
done_testing;
DESCRIPTION
The driver's half of the shared case table of DBIO::Test::Conformance (core ADR 0060). Core owns the cases and the runner; this class says how to reach an in-memory SQLite database, how to install a declaration into it through DBIO::SQLite::Deploy, and how to read a fact back through DBIO::SQLite::Introspect.
SQLite needs no server and no gate: an in-memory database is a server, so every case runs in a plain prove. It has no namespaces either, and each case gets a connection -- and with it a database -- of its own, so the default "conformance_namespace" in DBIO::Test::Conformance is enough.
The class is the one an extension dist reuses against its own composed storage; it names no storage class and never decides the driver, the DSN does (see "conformance_connect").
METHODS
conformance_live_available
True when DBD::SQLite loads. There is nothing else to gate on.
conformance_connect
Loads the SQLite schema component into the case's schema class and connects to a private in-memory database. storage_type is not set: the DSN selects the driver and core composes the storage over it.
The connection asks for foreign key enforcement, on_connect_call => 'use_foreign_keys' ("connect_call_use_foreign_keys" in DBIO::SQLite::Storage). SQLite enforces nothing until a connection says so, and the driver keeps that default; the cases that need a key to hold -- ddl-foreign-key, ddl-fk-actions -- are answered for a connection that opted in, which is how a SQLite application that wants foreign keys connects.
It asks for sqlite_unicode => 1 as well ("sqlite_unicode" in DBD::SQLite). Without it DBD::SQLite returns text as the bytes it stores, and the cases that bind characters (bind-non-ascii) read bytes back. The driver keeps that default, since an application may hold bytes in a text column on purpose; one that wants characters connects like this.
conformance_install
Installs the declaration with $schema->deploy, the public entry point, which hands over to "install" in DBIO::SQLite::Deploy.
conformance_cleanup
Disconnects. The database was in memory and goes with the connection.
conformance_diff_is_empty
True when "diff" in DBIO::SQLite::Deploy of the installed database against the same declaration has no changes.
conformance_upgrade
Connects the target schema class to the handle of the installed one, since a :memory: database is its connection, and runs "upgrade" in DBIO::Deploy::Base -- the public entry point -- through it with allow_destructive => 1: the upgrade cases drop on purpose, and the guard that holds a destructive diff back is the subject of diff-deploy-destructive-guard, not of these. The connection opts into foreign keys like "conformance_connect". A refusal of the diff ("Changes that are refused" in DBIO::SQLite::Diff::Column) is thrown from here as it came.
conformance_deploy
Connects like "conformance_upgrade" and returns DBIO::SQLite::Deploy->new(schema => $to), so the runner reaches apply and upgrade of the deploy class itself: the cases diff-deploy-inherited, diff-deploy-dry-run and diff-deploy-destructive-guard run for this driver.
conformance_answered_through
The table versions the answers were written against, per area: { DDL => 2, Diff => 4, Bind => 1 }, every list as it stands. Version 2 of the DDL list splits the type-size case into ddl-type-size-char and ddl-type-size-bit, version 2 of the Diff list splits U13 into diff-constraint-changed and diff-fk-action-changed, and every case of all three lists is answered: correctly, or by a refusal or deviation of "conformance_refusals".
Version 3 of the Diff list replaces diff-column-dropped-with-index by diff-indexed-column-dropped; it runs.
Version 4 of the Diff list adds the three deploy cases (diff-deploy-inherited, diff-deploy-dry-run, diff-deploy-destructive-guard); they run through "conformance_deploy".
conformance_refusals
Three declared refusals and three deviations.
ddl-qualified-source-name: SQLite has no schemas to qualify a table name with, so table('other.t') as a string is refused by "refuse_qualified_name" in DBIO::SQLite::Util from the DDL, naming the table and the scalar-ref form \'other.t', which stays literal SQL.
diff-column-added-not-null-populated and diff-not-null-over-nulls: SQLite cannot give the rows a table holds a value for a new NOT NULL column, nor accept a NOT NULL over a NULL. "_refuse_unfillable" in DBIO::SQLite::Deploy refuses both before the first statement, naming table and column.
bind-empty-string and bind-numeric-exact run through and differ: SQLite types the value, not the column. Text that is no integer is kept as text in an INTEGER column, and a NUMERIC column keeps 15 significant digits of what does not fit an integer. Both are the engine's documented rules (type affinity), declared as deviations with the reason; only a STRICT table, which the cases do not declare, rejects the first.
ddl-type-size-char runs through and differs: the size of CHARACTER(10) is written and read back, but SQLite never rejects eleven characters in it. It does not enforce a declared length, and the driver adds no CHECK to make it (maintainer decision 2026-10-12), so this is declared a deviation. The fact is the runner's own failure text, so a different wrong answer is not hidden behind it. For bind-numeric-exact it is the output of this perl for the double the column holds (its NV, its C runtime), not a fixed spelling.
diff-constraint-changed and diff-fk-action-changed are not refused: this driver applies both, by rebuilding the table (ADR 0003).
conformance_fact
Reads one fact through DBIO::SQLite::Introspect; the vocabulary is the one of "Facts" in DBIO::Test::Conformance. SQLite has no namespaces, so table_in_namespace is true only for main and a table that is there.
SEE ALSO
DBIO::Test::Conformance - the runner and the contract of the seams
DBIO::Test::Conformance::Cases::DDL - the DDL case list
DBIO::SQLite::Deploy - install and diff, as the cases reach them
DBIO::SQLite::Introspect - what the facts are read through
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.