NAME

DBIO::MSSQL::Deploy - Deploy and upgrade MSSQL schemas via test-deploy-and-compare

VERSION

version 0.900000

DESCRIPTION

DBIO::MSSQL::Deploy orchestrates schema deployment and upgrades for Microsoft SQL Server using the test-deploy-and-compare strategy.

The orchestration (install, diff, apply, upgrade) and the temp-database lifecycle are inherited from DBIO::Deploy::Base::TempDatabase: diff introspects the live database, deploys the desired DDL into a throwaway database, introspects that, and diffs the two models. This class supplies only the MSSQL-specific seams: the three class-name hooks and the CREATE/DROP DATABASE dialect.

my $deploy = DBIO::MSSQL::Deploy->new(
    schema => MyApp::DB->connect($dsn),
);
$deploy->install;                       # fresh
my $diff = $deploy->diff;               # or step-by-step
$deploy->apply($diff) if $diff->has_changes;
$deploy->upgrade;                       # convenience

METHODS

_create_temp_db

my $name = $self->_create_temp_db($dbh);

Creates a uniquely-named throwaway database with T-SQL CREATE DATABASE. MSSQL cannot run CREATE DATABASE inside a transaction, so any open transaction is committed and the statement runs with autocommit on.

_drop_temp_db

$self->_drop_temp_db($dbh, $name);

Drops the throwaway database with T-SQL DROP DATABASE.

_temp_connect_info

Overrides the base derivation: MSSQL DSNs use the Database= attribute, so both the rewrite and the append-when-absent case emit Database= (the base default appends dbname=, which an ODBC/Sybase MSSQL DSN does not honour).

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 123:

Unknown directive: =seealso