NAME

DBIO::PostgreSQL::DDL - Generate PostgreSQL DDL from DBIO schema classes

VERSION

version 0.900000

DESCRIPTION

DBIO::PostgreSQL::DDL generates PostgreSQL DDL statements directly from DBIO schema and result classes, without going through SQL::Translator. This produces correct, PostgreSQL-native SQL that preserves all PostgreSQL-specific features.

The generated DDL is used by "install" in DBIO::PostgreSQL::Deploy for fresh installs and by the test-deploy side of "diff" in DBIO::PostgreSQL::Deploy for upgrade diffing. Reach for this class directly when you want the raw SQL text; use DBIO::PostgreSQL::Deploy when you want database orchestration.

METHODS

install_ddl

my $sql = DBIO::PostgreSQL::DDL->install_ddl($schema);

Generates a complete PostgreSQL DDL script for the connected schema object. The script is ordered to satisfy dependencies:

1. CREATE EXTENSION IF NOT EXISTS statements
2. CREATE SCHEMA IF NOT EXISTS statements (skipping public)
3. Enum types, composite types, and functions from DBIO::PostgreSQL::PgSchema subclasses
4. CREATE TABLE statements with columns, primary keys, indexes, triggers, and RLS from DBIO::PostgreSQL::Result classes
5. ALTER DATABASE CURRENT SET for pg_settings
6. SET search_path TO from pg_search_path

Returns the DDL as a single string with statements separated by blank lines.

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 426:

Unknown directive: =seealso