DBIO::MySQL

MySQL and MariaDB driver for DBIO (fork of DBIx::Class::Storage::DBI::mysql).

Supports

Supports both DBD::mysql and DBD::MariaDB. Install the one matching your server version.

Usage

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

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

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

MySQL / MariaDB Features

Types

Indexes

MySQL-Specific Features

GIS Support (Spatial)

Introspection

Deploy

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

  1. Introspect live database via INFORMATION_SCHEMA (DBIO::MySQL::Introspect)
  2. Deploy desired schema to a temporary database (_dbio_tmp_<pid>_<time>)
  3. Introspect the temporary database the same way
  4. Diff source vs target (DBIO::MySQL::Diff)
  5. Drop the temporary database

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

Testing

Requires a running MySQL or MariaDB instance:

export DBIO_TEST_MYSQL_DSN="dbi:mysql:database=myapp"
export DBIO_TEST_MYSQL_USER=root
export DBIO_TEST_MYSQL_PASS=secret
prove -l t/

Offline tests (t/00-load.t, SQLMaker tests) run without a database.

Requirements

See Also

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

Repository

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