NAME

DBIx::Squirrel::Util - helpers shared by DBIx::Squirrel's modules

DESCRIPTION

Functions DBIx::Squirrel's modules share, exported on request. They're for DBIx::Squirrel itself, not for use elsewhere. They may change without notice.

FUNCTIONS

canonical
$string = canonical(\%options);

Returns options as a string, for the DBI's caches to key on. The same options give the same string.

install_sub
install_sub($full_name, $code);

Installs a subroutine by its full name, naming an anonymous one so.

is_name
$bool = is_name($name);

Returns true if a name can be a subroutine's.

iterator_going
$iterator = iterator_going($sth);

Returns the iterator going through a statement handle's results, if it has results left to hand out. Otherwise returns nothing.

shift_attrs
$attrs = shift_attrs(\@args);

Takes the attributes off the front of a list of arguments, if they're there: a hash reference, or undef.

split_attrs
($dbi_attrs, $ekorn_attrs) = split_attrs(\%attrs);

Splits attributes into the DBI's and DBIx::Squirrel's own, those starting ekorn_.

split_stages
@stages = split_stages(\@args);

Takes the stages, code references or pipelines, off the end of a list of arguments, and returns them.

unwrap_values
@values = unwrap_values($driver, $taken, $lists, @values);

Returns the bind values given, or those in an array reference given alone. The exception is an array reference that's the one value of a statement taking one: a list, for a list placeholder, or, with DBD::Pg, a PostgreSQL array. That's returned unchanged.

DIAGNOSTICS

Expected a reference to a HASH or ARRAY

The first argument after a statement was a reference, but not to a hash or an array. See "do" in DBIx::Squirrel::db.

SEE ALSO

DBIx::Squirrel

AUTHOR

Iain Campbell <cpanic@cpan.org>

LICENSE

Copyright (c) 2024-2026 by Iain Campbell.

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