NAME

DBIx::Class::SQLA2 - SQL::Abstract v2 support in DBIx::Class

SYNOPSIS

$schema->connect_call_rebase_sqlmaker('DBIx::Class::SQLA2');

DESCRIPTION

This is a work in progress for simplifying using SQLA2 with DBIC. This is for using w/ the most recent version of DBIC.

For a simple way of using this, take a look at DBIx::Class::Schema::SQLA2Support.

In order to have inserts passthru SQLA2 keys, you should use the DBIx::Class::Row::SQLA2Support component, which allows you to add a -sqla2 key w/ a hashref containing your passthroughs.

In order to support SQLA2 keys for bulk inserts (populate), use the DBIx::Class::ResultSet::SQLA2Support component. It adds a second arg to populate which allows you to add things to the final query (though you may get undefined behavior if you're creating deep relationships - real world experience would be nice here). In addition, it adds an upsert method to simplify the case of update on a primary key conflict (see there for more details).

EXPERIMENTAL

This role itself will add handling of hashref-refs to select lists + group by clauses, which will render the inner hashref as if it had been passed through to SQLA2 rather than doing the recursive function rendering that DBIC does.

Included Plugins

This will add the following SQLA2 plugins:

SQL::Abstract::Plugin::ExtraClauses

Adds support for CTEs, and other fun new SQL syntax

SQL::Abstract::Plugin::WindowFunctions

Adds support for window functions and advanced aggregates.

SQL::Abstract::Plugin::Upsert

Adds support for Upserts (ON CONFLICT clause)

SQL::Abstract::Plugin::BangOverrides

Adds some hacky stuff so you can bypass/supplement DBIC's handling of certain clauses

AUTHOR

Copyright (c) 2022-24 Veesh Goldman <veesh@cpan.org>

LICENSE

This module is free software; you may copy this under the same terms as perl itself (either the GNU General Public License or the Artistic License)