DBIO::PostgreSQL

PostgreSQL driver for DBIO (fork of DBIx::Class::Storage::DBI::Pg).

Supports

Usage

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

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

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

PostgreSQL Features

The driver supports the full range of PostgreSQL features:

Types

Schema Support

Row Level Security (RLS)

Indexes

Full-Text Search

Foreign Data Wrappers

PostgreSQL-Specific Features

Introspection (pg_catalog)

Deploy

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

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

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

Testing

Requires a running PostgreSQL instance:

export DBIO_TEST_PG_DSN="dbi:Pg:database=myapp"
export DBIO_TEST_PG_USER=postgres
export DBIO_TEST_PG_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-postgresql