NAME

DBIx::QuickORM::Dialect::PostgreSQL - PostgreSQL dialect for DBIx::QuickORM.

DESCRIPTION

The PostgreSQL-specific DBIx::QuickORM::Dialect. Introspects schema metadata from information_schema and the pg_* catalogs, drives transactions and savepoints via the DBD::Pg driver, supports async queries, and maps logical types (such as uuid) to native ones.

SYNOPSIS

my $dialect = DBIx::QuickORM::Dialect::PostgreSQL->new(dbh => $dbh, db_name => $name);

PUBLIC METHODS

$driver = $dialect->dbi_driver
$name = $dialect->dialect_name
$value = $dialect->quote_binary_data
$bool = $dialect->supports_returning_update
$bool = $dialect->supports_returning_insert
$bool = $dialect->supports_returning_delete
$bool = $dialect->async_supported
$bool = $dialect->async_cancel_supported

Feature flags and constants describing the PostgreSQL dialect.

$dialect->async_prepare_args

Bind args to issue a statement asynchronously.

$result = $dialect->async_result(%params)
$bool = $dialect->async_ready(%params)
$dialect->async_cancel(%params)

Async query lifecycle: collect a result, check readiness, or cancel.

$dialect->start_txn(%params)
$dialect->commit_txn(%params)
$dialect->rollback_txn(%params)
$dialect->create_savepoint(%params)
$dialect->commit_savepoint(%params)
$dialect->rollback_savepoint(%params)

Transaction and savepoint control via DBD::Pg. Each accepts an optional dbh parameter, defaulting to the dialect's own handle; savepoint methods take a savepoint name.

$stype = $dialect->supports_type($type)

Returns the native type name for a supported logical type (e.g. uuid), or nothing.

$version = $dialect->db_version

The PostgreSQL server version.

PUBLIC METHODS

$tables = $dialect->build_tables_from_db(%params)

Introspects all tables and views in the database and returns a hashref of name to schema-table object.

($pk, $unique, $links) = $dialect->build_table_keys_from_db($table, %params)

Introspects a table's primary key, unique keys, and foreign-key links from the pg_constraint catalog.

$columns = $dialect->build_columns_from_db($table, %params)

Introspects a table's columns from information_schema.columns and returns a hashref of column name to column object.

PRIVATE METHODS

$bool = $dialect->_col_field_to_bool($val)

Normalizes an information_schema truthy/falsey string (YES/NO, etc.) to a 1/0 boolean.

PUBLIC METHODS

$indexes = $dialect->build_indexes_from_db($table, %params)

Introspects a table's indexes from pg_indexes, parsing each index definition, and returns an arrayref of index specs.

SOURCE

The source code repository for DBIx::QuickORM can be found at https://github.com/exodist/DBIx-QuickORM.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright Chad Granum <exodist7@gmail.com>.

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

See https://dev.perl.org/licenses/