NAME

DBIO::DuckDB::DDL - Generate DuckDB DDL from DBIO Result classes

VERSION

version 0.900000

DESCRIPTION

DBIO::DuckDB::DDL generates a DuckDB DDL script from a DBIO::Schema class hierarchy. It is the desired-state side of the test-deploy-and- compare strategy used by DBIO::DuckDB::Deploy.

my $ddl = DBIO::DuckDB::DDL->install_ddl($schema_class_or_instance);

The output is plain SQL, suitable for executing one statement at a time against a fresh DuckDB database. Emits CREATE TABLE (inline columns, primary key, unique, foreign keys) and CREATE INDEX.

DuckDB has real sequences and real schemas (namespaces), but for the first cut we mirror the dbio-sqlite shape and emit only tables + indexes. Sequences can be added later when the ResultSource metadata carries them.

METHODS

install_ddl

my $ddl = DBIO::DuckDB::DDL->install_ddl($schema);

Returns the full installation DDL as a single string.

AUTHOR

DBIO Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.