DBIO::MSSQL

Microsoft SQL Server database driver for DBIO (fork of DBIx::Class).

Supports

Usage

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

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

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

MSSQL Features

Types

Schema Support

Introspection (INFORMATION_SCHEMA + sys)

MSSQL-Specific

Deploy

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

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

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

Testing

export DBIO_TEST_MSSQL_DSN="dbi:MSSQL:database=myapp"
export DBIO_TEST_MSSQL_USER=sa
export DBIO_TEST_MSSQL_PASS=secret
prove -l t/

For ODBC connections:

export DBIO_TEST_MSSQL_ODBC_DSN="dbi:ODBC:Driver={SQL Server};Server=localhost;Database=myapp"
export DBIO_TEST_MSSQL_ODBC_USER=sa
export DBIO_TEST_MSSQL_ODBC_PASS=secret
prove -l t/

Requirements

See Also

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

Repository

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