DBIO::Sybase
Sybase/ASE database driver for DBIO (fork of DBIx::Class).
Supports
- desired-state deployment via test-deploy-and-compare (DBIO::Sybase::Deploy)
- native introspection (DBIO::Sybase::Introspect)
- native diff (DBIO::Sybase::Diff)
- native DDL generation (DBIO::Sybase::DDL)
Usage
package MyApp::DB;
use base 'DBIO::Schema';
__PACKAGE__->load_components('Sybase');
my $schema = MyApp::DB->connect('dbi:Sybase:database=myapp');
DBIO core autodetects dbi:Sybase: DSNs and loads this storage automatically.
Sybase Features
Types
INT,BIGINT,SMALLINT,TINYINT- numeric typesVARCHAR,CHAR,TEXT- string typesBINARY,VARBINARY,IMAGE- binary typesDATE,TIME,DATETIME,DATETIME2- temporal typesDECIMAL,NUMERIC- fixed-point numeric
Schema Support
sysobjects,syscolumnsfor introspection- Identity columns for auto-increment
- Sybase-specific stored procedure language
Introspection (sysobjects, syscolumns)
sysobjects- table metadatasyscolumns- column metadatasysindexes- index informationsysreferences- foreign key constraints
Sybase-Specific
SET IDENTITY_INSERTfor explicit identity insertion@@IDENTITYfor inserted row retrieval- Text/image data handling
- Server-level configuration
Deploy
DBIO::Sybase::Deploy orchestrates test-deploy-and-compare:
- Introspect live database via sysobjects (DBIO::Sybase::Introspect)
- Deploy desired schema to a temporary database
- Introspect the temporary database the same way
- Diff source vs target (DBIO::Sybase::Diff)
Install (install_ddl) creates fresh schema. Upgrade diffs live vs. desired.
Testing
Requires a running Sybase/ASE instance:
export DBIO_TEST_SYBASE_DSN="dbi:Sybase:database=myapp"
export DBIO_TEST_SYBASE_USER=sa
export DBIO_TEST_SYBASE_PASS=secret
prove -l t/
Requirements
- Perl 5.36+
- DBD::Sybase
- DBIO core
See Also
DBIO::Introspect::Base, DBIO::Diff::Base, DBIO::Deploy