DBIO::DB2

IBM DB2 database driver for DBIO (fork of DBIx::Class).

Supports

Usage

package MyApp::DB;
use base 'DBIO::Schema';
__PACKAGE__->load_components('DB2');

my $schema = MyApp::DB->connect('dbi:DB2:database=myapp');

DBIO core autodetects dbi:DB2: DSNs and loads this storage automatically.

DB2 Features

Types

Schema Support

Introspection (SYSCAT)

Deploy

DBIO::DB2::Deploy orchestrates test-deploy-and-compare:

  1. Introspect live database via SYSCAT (DBIO::DB2::Introspect)
  2. Deploy desired schema to a temporary tablespace
  3. Introspect the temporary schema the same way
  4. Diff source vs target (DBIO::DB2::Diff)

Install (install_ddl) creates fresh schema. Upgrade diffs live vs. desired.

Testing

Requires a running DB2 instance:

export DBIO_TEST_DB2_DSN="dbi:DB2:database=myapp"
export DBIO_TEST_DB2_USER=db2inst1
export DBIO_TEST_DB2_PASS=secret
prove -l t/

Requirements

See Also

DBIO::Introspect::Base, DBIO::Diff::Base, DBIO::Deploy

Repository

https://codeberg.org/dbio/dbio-db2