NAME

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

VERSION

version 0.900007

DESCRIPTION

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

my $ddl = DBIO::Informix::DDL->install_ddl($schema_class_or_instance);
# CREATE TABLE ...; CREATE INDEX ...; ...

Informix holds one index over a column list (-350). Two declarations over the same columns (two indexes, an index and a unique constraint, two unique constraints, an index and an is_unique column) are refused with a message naming both, never one of them left out. Two things say nothing more and are not written: a unique constraint over exactly the primary key's columns, and a plain index over a foreign key's columns (the key builds one). A foreign key whose target columns only a unique index covers is refused as well: Informix wants a primary key or a unique constraint there (-297), and the message says to declare it with add_unique_constraint. The columns of a foreign key are written in the order of the target key (the first primary key or unique constraint over those columns), as the server takes a reference only in that order (-297): a key over (a, b) onto a key over (b, a) is built as FOREIGN KEY (b', a') REFERENCES t(b, a).

METHODS

install_ddl

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

Returns the full installation DDL as a single string. $schema may be a connected schema instance or a schema class name.

SEE ALSO

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.