The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::SQLEngine::DriverTrait::NoUnions - For databases without select unions

SYNOPSIS

  # Classes can import this behavior if they don't have native unions
  use DBIx::SQLEngine::DriverTrait::NoUnions ':all';
  
  # Implements a workaround for unavailable sql_union capability
  $rows = $sqldb->fetch_select_rows( union => [
    { table => 'foo', columns => '*' },
    { table => 'bar', columns => '*' },
  ] );

DESCRIPTION

This package supports SQL database servers which do natively provide a SQL select with unions. Instead, queries with unions are executed separately and their results combined.

Note: this feature has been added recently, and the interface is subject to change.

Caution

Because of the way DBIx::AnyDBD munges the inheritance tree, DBIx::SQLEngine subclasses can not reliably inherit from this package. To work around this, we export all of the methods into their namespace using Exporter and @EXPORT.

In addition we go through some effort to re-dispatch methods because we can't rely on SUPER and we don't want to require NEXT. This isn't too complicated, as we know the munged inheritance tree only uses single inheritance. See the source code for the _super_dispatch function that handles this.

REFERENCE

The following methods are provided:

dbms_union_unsupported()

Set to 1.

sql_union()

Calls Carp::confess().

fetch_select()

Simply calls the superclass method unless the union clause is provided. Runs each of the provided queries separately and concatenates their results.

fetch_select_rows()

Simply calls the superclass method unless the union clause is provided. Runs each of the provided queries separately and concatenates their results.

visit_select()

Simply calls the superclass method unless the union clause is provided. Runs each of the provided queries separately and concatenates their results.

Note: This method doesn't yet munge the column names retrived by the later queries.

visit_select_rows()

Simply calls the superclass method unless the union clause is provided. Runs each of the provided queries separately and concatenates their results.

SEE ALSO

See DBIx::SQLEngine for the overall interface and developer documentation.

See DBIx::SQLEngine::Docs::ReadMe for general information about this distribution, including installation and license information.