DBIO::Firebird
Firebird and InterBase database driver for DBIO (fork of DBIx::Class).
Supports
- desired-state deployment via test-deploy-and-compare (DBIO::Firebird::Deploy)
- native introspection (DBIO::Firebird::Introspect)
- native diff (DBIO::Firebird::Diff)
- native DDL generation (DBIO::Firebird::DDL)
Usage
package MyApp::DB;
use base 'DBIO::Schema';
__PACKAGE__->load_components('Firebird');
my $schema = MyApp::DB->connect('dbi:Firebird:database=myapp');
DBIO core autodetects dbi:Firebird: DSNs and loads this storage automatically.
Firebird Features
Types
INTEGER,BIGINT,SMALLINT- numeric typesVARCHAR,CHAR,BLOB- string/binary typesDATE,TIME,TIMESTAMP- temporal typesDECIMAL,NUMERIC- fixed-point numericFLOAT,DOUBLE- floating-point
Schema Support
- RDB$ system tables for introspection
- Firebird-specific generators/sequences for auto-increment
Introspection (RDB$)
RDB$RELATIONS- table metadataRDB$FIELDS- column typesRDB$INDICES- index informationRDB$TRIGGERS- triggers and generators
Firebird-Specific
- Generator-based auto-increment
SELECT GEN_ID(generator, 1) FROM RDB$DATABASEpattern- Transaction isolation levels
- Multi-database support via unified API
Deploy
DBIO::Firebird::Deploy orchestrates test-deploy-and-compare:
- Introspect live database via RDB$ tables (DBIO::Firebird::Introspect)
- Deploy desired schema to a temporary database file
- Introspect the temporary database the same way
- Diff source vs target (DBIO::Firebird::Diff)
Install (install_ddl) creates fresh schema. Upgrade diffs live vs. desired.
Testing
Requires a running Firebird instance:
export DBIO_TEST_FIREBIRD_DSN="dbi:Firebird:database=myapp"
export DBIO_TEST_FIREBIRD_USER=sysdba
export DBIO_TEST_FIREBIRD_PASS=secret
prove -l t/
Requirements
- Perl 5.36+
- DBD::Firebird
- DBIO core
See Also
DBIO::Introspect::Base, DBIO::Diff::Base, DBIO::Deploy