NAME
DBIO::Firebird::Test::Conformance - Answers the shared conformance case table for the Firebird driver
VERSION
version 0.900004
SYNOPSIS
use DBIO::Firebird::Test::Conformance;
DBIO::Firebird::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 a Firebird server, how to install a declaration into it through DBIO::Firebird::Deploy, and how to read a fact back through DBIO::Firebird::Introspect and the rdb$* tables.
The server is the one DBIO_TEST_FIREBIRD_DSN, DBIO_TEST_FIREBIRD_USER and DBIO_TEST_FIREBIRD_PASS name; without the DSN (or without DBD::Firebird) only the declarations are checked. The user needs the right to create and drop databases: "diff" in DBIO::Firebird::Deploy builds its target in a temporary database next to the live one.
The namespace of a case is the test database itself. Firebird has no schemas before version 6, so a case cannot be given a schema of its own, and the diff compares the whole visible database. "conformance_namespace" therefore refuses to run in a database that holds a table or view already (it is not this run's to drop), and otherwise returns the mark of the case: the names of the tables and views its sources will create. "conformance_cleanup" removes those objects and nothing else (their foreign keys, then the views, then the tables, where they exist), through a connection of its own, after the case's connection is closed. The core runner calls the cleanup also when the namespace seam threw, with no mark; then it disconnects and drops nothing, so a database that was refused is left exactly as it was. The class names no storage class: the schema component declares the driver.
METHODS
conformance_live_available
True when DBIO_TEST_FIREBIRD_DSN is set and DBD::Firebird loads.
conformance_connect
Loads the Firebird schema component into the case's schema class and connects with the connection attributes the driver's own live tests use. It asks for no datetime_setup: the storage puts every connection into the ISO date and timestamp formats itself ("connect_call_datetime_setup" in DBIO::Firebird::Storage::InterBase). It sets LongReadLen to one million bytes, as the driver's live tests do for the BLOBs they read whole: DBD::Firebird dies on a longer value otherwise.
conformance_namespace
Checks that the database holds no user table or view and returns the mark of the case: { tables => [ ... ], views => [ ... ] }, the names of the tables and views the sources of the schema will create, and, for a Diff case, the ones its second declaration adds (a literal name, table(\'x'), and a subquery source are not named; a source twice over one name once). A database that holds a relation already is not the run's to use or clean: the case ends with the names of what is there, and there is no mark.
conformance_install
Installs the declaration with $schema->deploy, the public entry point, which hands over to "install" in DBIO::Firebird::Deploy.
ddl-view-declared runs like the other cases: core's runner builds the view definition through the hook conformance_quote_ident, whose default quotes with the quote character of the SQL maker ("), so the definition names the base table the way the driver created it (quoted, lower case). This class needs no hook of its own.
conformance_cleanup
Disconnects the case's connection, then removes the objects of the mark conformance_namespace returned -- first their foreign keys, then the views, then the tables, each where it exists -- through a connection of its own. Without a mark (the namespace seam threw: the database was not empty) it only disconnects. It never drops "everything in the database": what is there and not named by the mark is somebody else's.
conformance_diff_is_empty
True when "diff" in DBIO::Firebird::Deploy of the installed schema against the same declaration has no changes.
conformance_upgrade
Loads the Firebird component into the target schema class, connects it with the parameters of "conformance_connect" and runs "upgrade" in DBIO::Firebird::Deploy -- the public entry point -- through it. The connected target schema is returned. A refusal of the diff ("COLUMN CHANGES THE SERVER REFUSES" in DBIO::Firebird::Diff::Column, "refusal" in DBIO::Firebird::Diff::Table) is thrown from here as it came.
conformance_deploy
The deploy object over the target schema, for the deploy cases of the Diff list (table version 4): the target class is connected exactly as "conformance_upgrade" connects it (the case's own connection closed first, for the reason given there) and the object is DBIO::Firebird::Deploy->new(schema => $to). The runner calls apply and upgrade on it and hands the target schema to "conformance_cleanup", which drops the tables and views of the case's mark; the namespace is the database, so nothing is handed over.
conformance_answered_through
The table versions the answers were written against, per area: { DDL => 2, Diff => 4, Bind => 1 } (version 2 of the Diff list splits U13 into diff-constraint-changed and diff-fk-action-changed).
Version 3 of the Diff list replaces diff-column-dropped-with-index by diff-indexed-column-dropped; it runs.
Version 4 adds the three deploy cases diff-deploy-inherited, diff-deploy-dry-run and diff-deploy-destructive-guard (ADR 0080), which run through "conformance_deploy". "conformance_upgrade" releases the destructive and lossy operations of its diff (allow_destructive): the cases of the list state what the database must look like afterwards, and the guard has its own case.
conformance_refusals
The declared refusals and deviations:
ddl-type-size-bit(refusal)-
bit: Firebird has no type for a bit string of a fixed width.ddl-type-size-charis answered, not refused:character(10)reads back with size 10 and the server rejects an 11-character value (t/84). ddl-enum-value-apostrophe(refusal)-
enum: Firebird has no enumerated type. ddl-qualified-source-name(refusal)-
A dotted table name: Firebird has no schemas before version 6.
ddl-default-digit-string(deviation)-
char(5)with the default'007'reads back as'007 ': Firebird pads aCHAR(n)value with blanks to its length. That is the type's definition; the driver does not trim. diff-column-added-not-null-populated(refusal)-
A
NOT NULLcolumn without a default added to a table that holds rows: Firebird has no value for the rows already there. The driver refuses it itself, before the first statement, naming table and column ("_refuse_unfillable" in DBIO::Firebird::Deploy); the server's own answer would come half way through the upgrade. diff-not-null-over-nulls(refusal)-
A column that becomes
NOT NULLover aNULL: the server refuses (Cannot make field NOT NULL because there are NULLs present). The driver asks the table first and refuses before the first statement, the same way. bind-long-string(refusal)-
A text of 32 769 characters is stored and read back, but it cannot be searched by its value: Firebird compares a BLOB with a
VARCHAR, and aVARCHARholds 32 765 bytes (8191 characters of UTF8) at most, so no parameter can carry the value, and DBD::Firebird takes no BLOB parameter in aSELECT. The storage refuses the search itself, before the DBD, naming table and column ("A BLOB compared with a bound value" in DBIO::Firebird::Storage::InterBase). The shorter values of the case (4001, 8001 characters) run through. bind-numeric-exact(refusal)-
NUMERIC(20,4) is an INT128: the server has it from Firebird 4, but DBD::Firebird 1.39 can neither bind nor read one.
install_ddlrefuses the column on every server, naming table and column (DBIO::Firebird::DDL; the fact is held by t/97-numeric-int128-dbd-live.t).
The other Bind cases run through: text and BLOB comparisons by a cast parameter, non-ASCII text by the UTF8 connection, a number for a numeric column checked before the DBD reads it ("Text is UTF8 on every native connection" in DBIO::Firebird::Storage::InterBase).
conformance_fact
Reads one fact through DBIO::Firebird::Introspect (the index count straight from rdb$indices); the vocabulary is the one of "Facts" in DBIO::Test::Conformance.
SEE ALSO
DBIO::Test::Conformance - the runner and the contract of the seams
DBIO::Test::Conformance::Cases::DDL - the DDL case list
DBIO::Firebird::Deploy - install and diff, as the cases reach them
DBIO::Firebird::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.