NAME

DBIx::QuickORM::Handle - Build a query and fetch its rows.

DESCRIPTION

A handle is a query over a source (DBIx::QuickORM::Role::Source): a table, an SQL query, or tables joined together. Modifiers such as where and order_by each return a new handle, so a handle can be refined and reused freely. The fetching methods run the query and hand out rows. The writing methods update or delete what it matches.

A handle is stateless until its query is sent. Then the results are cached on it until clear. Every reading method and every iter shares that one run of the query. A modifier's new handle starts without it.

Running the query fetches every row at once, ingests the rows of a table with a primary key into the lookup table (see DBIx::QuickORM) unless the handle is no_cache (or bare), and hands them out through an iterator (DBIx::QuickORM::Iterator).

The SQL comes from the ORM's sql_builder, whose documentation describes the syntax of where and order_by. The default is DBIx::QuickORM::SQLBuilder::SQLAbstract, using SQL::Abstract's syntax.

Rows are built with the handle's row_class when one was set (even to undef, for row data), otherwise as the ORM resolves them for the table. Rows of a query use the ORM's row_class. Rows of a join are DBIx::QuickORM::JoinRow objects (see "Joins"), and computed rows are DBIx::QuickORM::AggregateRow objects (see "Computed columns").

SYNOPSIS

my $h = $orm->handle('users')
    ->where({name => {-like => 'A%'}})
    ->order_by('name')
    ->limit(10);

my $n   = $h->count;
my @all = $h->all;

my $user = $orm->handle('users')->find($id);
$orm->handle('posts')->where({views => 0})->delete;

EXAMPLES

Filter, sort, and page

my @page = $orm->handle('users')
    ->where({
        name  => {-like => 'A%'},
        email => {'!=' => undef},
    })
    ->order_by([{-desc => 'created'}, 'name'])
    ->limit(20)
    ->offset(40)
    ->all;

Narrow or widen a condition

my $alice   = $orm->handle('users')->where({name => 'Alice'});
my $emailed = $alice->and({email => {'!=' => undef}});    # both conditions
my $either  = $alice->or({name => 'Bob'});                # either condition
my $bob     = $alice->where({name => 'Bob'});             # where replaces the condition

Compare with SQL

use DBIx::QuickORM::Value qw/sql/;

my @old = $orm->handle('users')
    ->where({created => {'<' => sql("now() - interval '30 days'")}})
    ->all;

Read only some fields

my @users = $orm->handle('users')->fields(['name'])->all;    # name, plus the primary key
# a field not fetched loads on first read
my $email = $users[0]->field('email');

Get plain hashrefs instead of row objects

my @data = $orm->handle('users')->data_only->all;
my $name = $data[0]->{name};

# hashrefs the row cache never sees
my @bare = $orm->handle('users')->bare->all;

Query with your own SQL

my $dupes = $orm->handle(
    \['SELECT name, COUNT(*) AS n FROM users GROUP BY name HAVING COUNT(*) > ?', 1],
);
my @dupes = $dupes->all;
my @named = $dupes->where({name => 'Alice'})->all;    # the query becomes a subquery

Insert many rows and get them back

my $posts = $orm->handle('posts')->insert_many(
    [
        map {
            +{
                user_id => $id,
                title   => "Post $_",
            }
        } 1 .. 3
    ],
);    # an arrayref of the new rows

Loop over the same rows twice at once

Each iter call returns a new iterator with its own position, so each loop has its own. They share the handle's one run of the query.

my $h = $orm->handle('posts')->order_by('id');

my @pairs;
my $outer = $h->iter;
while (my $left = $outer->next) {
    my $inner = $h->iter;    # the same rows, no second query
    while (my $right = $inner->next) {
        push @pairs => [$left->field('id'), $right->field('id')];
    }
}

ATTRIBUTES

$orm = $h->orm
$source = $h->source

Both required.

$state = $h->state

The iterator state (see DBIx::QuickORM::Iterator), undef unless given. A new where (also through and or or) or a join drops it.

$mode = $h->mode

async, aside, or forked, or undef for an ordinary handle.

PUBLIC METHODS

Modifiers

my $users  = $orm->handle('users');
my $recent = $users->order_by({-desc => 'created'})->limit(5);    # $users is unchanged
# 5: without an argument, the setting
my $limit  = $recent->limit;

Each returns a new handle with the one setting replaced and no cached rows, and leaves the handle it was called on unchanged. So a modifier called in void context would do nothing, and croaks instead. One that takes a value returns the current setting when called without one. An argument of the wrong shape croaks, at the latest when the query runs.

$h2 = $h->where($where)

The condition: a hashref or arrayref in the builder's syntax, an sql() marker, or a plain string of SQL. The where builders render it (see where_builders).

A plain string is raw SQL, used as written. Never interpolate untrusted input into it. Pass values as binds with sql('... ?', $value).

A new where replaces the old one entirely, including one follow_fk set. Use and to narrow a handle's condition instead.

$h2 = $h->and($where)
$h2 = $h->or($where)

The handle with its where combined with $where: rows must meet both (and) or either (or).

Both need a condition to add to: on a handle without a where, or with an empty one ({}, [], or ''), they croak. Use where there. Value markers work in either part. Neither returns the current setting, but where does.

A side that is wholly a string, sql(), or \[...] is put in parentheses when combined, so an OR in it stays grouped. A literal you nest yourself inside -and or -or is yours to parenthesize.

$h2 = $h->order_by($order)

The order of the rows, in the builder's syntax.

$h2 = $h->limit($n)
$h2 = $h->offset($n)

The most rows to return, and how many rows to skip before them.

$h2 = $h->fields(\@fields)

Selects only these fields. The primary key is always added. Without it the table's default fields are selected (every column for a query).

$h2 = $h->fields({$name => $spec, ...})

Computed columns, each selected as $name. See "Computed columns". The rows are computed rows.

$h2 = $h->group_by(@fields)
$h2 = $h->having($condition)

Group the rows by these fields, and keep the groups matching the condition. The rows are computed rows.

having is in the builder's syntax, as for where. It can name grouped fields and computed fields, or take an sql() marker such as sql('COUNT(*) > ?', 2). A computed field's name goes to MySQL and MariaDB as written. Elsewhere the builder writes the field's SQL in its place (PostgreSQL rejects a select alias in HAVING).

Without computed fields the handle selects the grouped fields, or the fields given as a list. A handle with having but neither croaks when run.

SQLite sends a bind in an sql() marker as text, which an aggregate's number never matches. Cast the bind there: sql('COUNT(*) > CAST(? AS INTEGER)', $n).

$h2 = $h->row_class($class_or_undef)

The class rows from this handle are built with. Undef means row data.

A class without a new is loaded now, as the ORM loads its row classes. One that cannot be loaded croaks.

$h2 = $h->data_only

Shorthand for row_class(undef): rows come back as row data, as the CRUD operations' data => 1 gives. A row object given to update_row or refresh_row is still returned as itself. Pass data => 1 for its row data.

Table rows still go through the lookup table. For a table with a primary key each hashref is the cache's own copy, so never change it. Use bare for hashrefs the cache never sees.

It takes no argument. row_class($class) undoes it.

$h2 = $h->no_cache

Its queries skip the lookup table: rows come back as fetched, and nothing the ORM holds changes. find and refresh_row use the cache as their own options say. It takes no argument. Undo it with cache.

The rows, row objects or hashrefs, are not canonical. Writing with them croaks under the default enforce_canon. find or refresh_row gives a canonical row.

$h2 = $h->cache

Undoes no_cache: reads go through the lookup table again and their rows are canonical. It takes no argument.

$h2 = $h->bare

Shorthand for data_only and no_cache together: rows come back as hashrefs, as fetched, and the lookup table never sees them. Changing one changes nothing the ORM holds, though the handle's other reads hand out the same hashref.

They are not canonical, so writing with them croaks under the default enforce_canon. It takes no argument. row_class($class) brings back row objects, and cache brings back the lookup table.

$h2 = $h->where_builders(\@builders)

The where builders this handle's where is rendered through, replacing the ORM's where_builders (see DBIx::QuickORM). Each class is loaded as the ORM loads them. Without an argument it returns the handle's own setting, undef unless set.

Computed rows are keyed by the selected names, which the order may name. They belong to no table: no primary key is added and they never enter the lookup table.

They are DBIx::QuickORM::AggregateRow objects, which inflate and follow foreign keys by each column's spec. When the row class resolved for the source (the table's, or the ORM's) is undef they are hashrefs. A handle row_class replaces either: undef for hashrefs, or a class built as for a query's rows.

Computed columns

use DBIx::QuickORM::Value qw/sql/;

my @per_user = $orm->handle('posts')
    ->group_by('user_id')
    ->order_by('user_id')
    ->fields({
        # the field itself, with its type and foreign key
        user_id => 'user_id',
        # COUNT(*)
        posts   => [count => '*'],
        # an SQL expression: no type, no foreign key
        titles  => sql('COUNT(DISTINCT title)'),
        # SUM(views)
        views   => [sum => 'views'],
        # MAX(id), followed to that post
        latest  => {
            agg => [max => 'id'],
            fk  => 'posts',
        },
    })
    ->all;

my $count  = $per_user[0]->field('posts');
my $user   = $per_user[0]->follow_fk('users')->only;
my $latest = $per_user[0]->follow_fk('posts')->only;

fields({$name => $spec}) takes one of these per column:

$name => 'field'

The field itself (alias.field on a join), with the facts like gives below: its type and foreign keys.

$name => sql(...)
$name => \'SQL'

An SQL expression (see DBIx::QuickORM::Value), with no type and no foreign key. \'SQL' is short for sql('SQL').

$name => [$func, 'field']

FUNC(field), the field quoted for the database. $func must be a word (it is written into the SQL), and the field must exist. When $func is min or max, or one of the ORM's like_aggregates (any case), the result is one of the field's values, so the column takes the field's type and foreign keys. Any other function's result has neither.

The field * gives FUNC(*): [count => '*'] counts rows. Such a column has no type or foreign key. A function that does not take * fails when the query runs, with the database's error.

$name => {sql => sql(...) | agg => [$func, 'field'], type => $type, db_type => $db_type, fk => $fk, like => 'field'}

Exactly one of sql or agg, which work as above. The other keys adjust the column:

like => 'field'

The column takes the field's facts: its type, its declared type (and what follows from it, such as affinity), and its single-field foreign keys. With like, nothing comes from agg's field.

type => $type

The type, named as in the ORM's types. Replaces what like or agg gave.

db_type => $db_type

The declared type. Replaces what like or agg gave, but keeps the type they implied. Give type too to change it.

fk => $fk

A single-field foreign key, replacing what like or agg gave: a table name (that table's primary key, which must be one field), [$table, $field], or {$table => $field}.

Croaks on an unknown key, an unknown field, a function name that is not a word, or an fk naming a table or field not in the map.

Running elsewhere

# the query starts, and iter() returns at once
my $it = $orm->handle('posts')->async->iter;
do_something_else() until $it->ready;
my @posts = $it->all;

my $aside  = $orm->handle('posts')->aside->iter;     # on a second connection
my $forked = $orm->handle('posts')->forked->iter;    # in a child process
$orm->insert(users => {name => 'Busy'});             # the ORM's own connection stays free
my @all = ($aside->all, $forked->all);
$h2 = $h->async

The handle's query starts without waiting on its first read: iter returns a pending iterator (see DBIx::QuickORM::Iterator), whose ready checks without waiting and whose reading methods wait for the rows. Every iterator of the handle shares that one query.

The query runs on the ORM's own connection, so its rows are canonical like any other's, inside a transaction or not. Until it is collected the connection is busy, and every other query, write, and transaction statement on it croaks.

A query not yet collected is cancelled once nothing can read it: the handle is freed or cleared, and so is every iterator over it. A transaction rolled back because its block threw or it went out of scope cancels it too. Its iterators then throw when read. On PostgreSQL, cancelling inside a transaction aborts that transaction. MySQL and MariaDB cannot cancel, so they wait for the result and discard it.

Needs a database with async queries (PostgreSQL, MySQL, MariaDB). Croaks on any other. On some platforms a child forked while a PostgreSQL async query is pending may crash on exit (https://github.com/bucardo/dbdpg/issues/218).

$h2 = $h->aside

Like async, but each query runs on a new connection from the ORM's connector, so the ORM's own connection stays free.

The connection is closed once the rows are collected, or when the query is cancelled before that. It sees only committed data. Its rows are ingested as usual.

Starting the query, or reading its rows (ready included), croaks while a transaction is open. A query started before a transaction may run during it, so read it after the transaction ends. Its rows may then be stale if the transaction changed the same rows.

Needs a database with async queries that a second connection can reach (not an in-memory database). On an ORM given a dbh, aside itself croaks.

$h2 = $h->forked

Each query runs in a forked child process, on a new connection from the connector, and the child sends the rows back and exits.

The iterator is pending as for async. Rows are ingested, and transactions are refused, as for aside. An error in the child is thrown on collection as The forked query failed: ... with the child's message. Cancelling the query kills and reaps the child.

The child never touches the parent's connection. A forked query can race changes the parent makes meanwhile to the same rows, as any other reader can.

Needs a database a second connection can reach (not DuckDB or an in-memory SQLite database). On an ORM given a dbh, forked itself croaks.

$bool = $h->can_async
$bool = $h->can_aside
$bool = $h->can_forked

True when the mode can run here, false where it would croak.

$h2 = $h->maybe_async
$h2 = $h->maybe_aside
$h2 = $h->maybe_forked

The mode when it can run, otherwise no mode change. Either way a new handle without cached rows, as for any modifier. Void context croaks.

On an ordinary handle, falling back runs the query normally on the ORM's connection. A handle already in another mode keeps it. Inside a transaction that query sees the transaction's own uncommitted writes, while aside and forked see committed data only.

Everything else (iter, ready, all, count) works the same either way.

Joins

my @rows = $orm->handle('posts')
    ->join('users', as => 'author')
    ->where({
        'author.name' => 'Alice',
        'posts.views' => {'>' => 10},
    })
    ->order_by('posts.id')
    ->all;

for my $row (@rows) {
    my $post   = $row->row('posts');
    my $author = $row->row('author');
    my $title  = $row->data->{'posts.title'};
}

# Every user and their posts, keeping users without any.
my @users = $orm->handle('users')
    ->left_join('posts', link => {id => 'user_id'})
    ->order_by('users.name')
    ->all;
$h2 = $h->join($table, as => $name, from => $name, via => \%via)
$h2 = $h->inner_join($table, ...)
$h2 = $h->left_join($table, ...)

Join another table to a table handle, or to a join handle (see DBIx::QuickORM::Source::Join). join and inner_join are inner joins, left_join a left join.

Options (an unknown one croaks):

as => $name

The component's name, the table name by default. A table can be joined more than once, even to itself, under different names. A name already taken croaks.

from => $name

The component the link starts at, the base table by default.

The foreign key to join on, {from_field => field}, as follow_fk takes it (see "Following foreign keys" in DBIx::QuickORM). Without it there must be exactly one foreign key between the two tables.

via => \%via

The fields to join on when the map knows no key between the tables, in the same form: via => {editor_id => 'id'}. Every field must exist. Not with link.

On a join handle where, order_by, fields, group_by, and having name fields as component.field. fields croaks for any other name.

The rows are DBIx::QuickORM::JoinRow objects. With row_class(undef) they are each row's raw data instead, a hashref keyed component.field. Any other row_class croaks. A join cannot be written through: write through its component rows.

Fetching

my $h = $orm->handle('users')->order_by('name');

my $first = $h->first;    # runs the query
my $last  = $h->last;     # same rows, no second query
my @all   = $h->all;

my $bob = $h->where({email => 'bob@example.com'})->only;    # one row or undef, croaks on more

my @names;
while (my $user = $h->next) {    # the handle's own position
    push @names => $user->field('name');
}

my $it = $h->iter;    # a new position over the same rows
$h->clear;            # forget the rows, so the next read runs the query again
$row = $h->first
$row = $h->last
@rows = $h->all
$row = $h->only
$bool = $h->ready
$row = $h->next
$h->reset

The iterator methods (see DBIx::QuickORM::Iterator), on the handle's own iterator over the handle's one run of the query.

The query runs on the first read (these or iter), and the rows stay on the handle until clear. A modifier's new handle does not share them.

$it = $h->iter

A new iterator, every call, with its own position over the handle's one run of the query. The first read sends the query. Later calls reuse its rows.

In async, aside, or forked mode there is one background query per handle, however many iterators read it. Collecting through any of them collects for all.

$h->clear

Forgets the handle's cached rows and its own position, in place, so the next read sends the query again. Returns nothing.

Iterators already returned by iter keep the old rows. The ORM's lookup table is untouched. clear_cache on the ORM clears that.

$n = $h->count

How many rows match the where, counted by the database (SELECT COUNT(*)).

The order, limit, and offset are ignored, and nothing is ingested. It runs at once on the ORM's connection, whatever the handle's mode. Croaks with a group_by or having. Count groups with computed fields instead, fields({n => [count => '*']}).

Writing

my $posts = $orm->handle('posts');

my $post = $posts->insert({
    user_id => $id,
    title   => 'Draft',
});
$posts->update_row($post, {title => 'Final'});
$posts->delete_row($post);

my $changed = $posts->where({user_id => $id})->update({views => 0});    # how many rows changed
my $deleted = $posts->where({views => 0})->delete;                       # how many rows went

These need a table handle. On a query or join handle they croak.

$count = $h->update(\%changes)
$count = $h->delete
$count = $h->delete(mark_deleted => 1)

Updates or deletes every row matching the where (every row of the table without one) in one statement, and returns the number of rows the database reports.

Changes are deflated as for update_row, and a field the table does not have croaks. update takes exactly one hashref. delete takes only mark_deleted. Both croak when the handle has an order, limit, offset, group_by, or having.

The ORM then drops every canonical copy of the table's rows, since it cannot tell which rows changed. Inside a transaction that includes the table's rows cached from before the transaction began: they are dropped, and rolling the outermost transaction back does not bring them back.

mark_deleted => 1 makes delete also learn which rows it deleted. Held rows for them say was_deleted, as after a row delete. The table's other rows are dropped as usual. A rollback undoes the marks. A table without a primary key croaks.

my $stale = $posts->find($post_id);
$posts->where({views => 0})->delete(mark_deleted => 1);
my $gone = $stale->was_deleted;    # true if that post had no views

The cost: the database sends back the primary key of every deleted row, and the ORM holds them all at once, so a huge delete uses memory in proportion.

MySQL has no RETURNING on DELETE (MariaDB has), so there it is slower: a SELECT ... FOR UPDATE of the keys runs first, locking the rows until the transaction ends, then the DELETE. Outside a transaction both run in one of their own. A row another session inserts and commits between the two statements may be deleted without being marked (MySQL and Percona at READ COMMITTED, not MariaDB, which uses RETURNING).

$row = $h->insert(\%fields, %opts)
\@rows = $h->insert_many(\@rows, %opts)
$row = $h->find($pk, %opts)
$row = $h->update_row($row_or_data, \%changes, %opts)
$count = $h->delete_row($row_or_data, %opts)
$row = $h->refresh_row($row_or_data, %opts)

The ORM's CRUD operations (see "CRUD operations" in DBIx::QuickORM) on the handle's table, with rows built as the handle builds them.

They follow the ORM's return rule, building rows with the handle's row class.

refresh_row takes row data, a row, or a primary key. find is refresh_row given a primary key. A key comes in any form:

my $users = $orm->handle('users');
my $user  = $users->find({id => $id});    # a hashref of the key fields (row data works)
$user = $users->find([$id]);              # an arrayref of the values
$user = $users->find($id);                # a single value, for a single-field key

The arrayref holds every key field's value, such as [$org_id, $user_id], in the primary key's declared order, not the table's column order. A row object works as its row data. Key values are deflated like any value sent, so a DateTime or a value marker works.

A typed key finds the cached row in any form: a DateTime in any zone or the database's text, a UUID in upper case or as 16 bytes.

The database gets the key as you pass it, deflated, while the cache matches canonical values. On a text column, which compares exact text, pass the form it stores, or give the field a format (see "Field hints" in DBIx::QuickORM::Role::Type).

normalize_pk in DBIx::QuickORM::Map lists what croaks.

Each croaks when the handle has a where, order, limit, offset, group_by, or having.

$row = $h->find_or_insert(\%fields, by => \@fields, %opts)

The ORM's find_or_insert (see "Finding or inserting" in DBIx::QuickORM) on the handle's table, building the row with the handle's row class.

It croaks as the CRUD operations above do, and on a join or query handle.

PRIVATE METHODS

$it = $h->_iter
$it = $h->_iter(\@frame)

The handle's own iterator, made on the first read by sending the query. It holds the query every iter shares, so a pending query lives as long as the handle or any of its iterators. @frame, or its caller's (a public reader's), goes to _send.

@out = $h->_read($method)

The handle's iterator's $method, for the reader of that name. While the query is pending, the reader's frame goes in the query's frame for the collection (see DBIx::QuickORM::Iterator), so the rows it brings arrive under that frame. A collected query is read as it is.

\%query = $h->_send(\@frame)

Sends the handle's query and returns the query hashref its iterators share (see DBIx::QuickORM::Iterator): the rows, or the pending query in a background mode. Rows read at once arrive under @frame in the lookup table's caller slot, unless it is set. aside and forked croak while a transaction is open, and give the pending query a blocked that refuses reads while one is.

$out = $h->_primitive($method, @args)

The ORM's CRUD operation on the handle's table, with rows built as the handle builds them.

$value = $h->_modify($method, $key)
$h2 = $h->_modify($method, $key, $value)

The setting, or a copy of the handle with it replaced, without the iterator (and without the state when the where or the source changes). $method is the public modifier, for messages. Croaks on more than one argument, a bad fields or row_class value, or void context, where the copy would be lost.

$h2 = $h->_combine_where($op, $where)

The handle with its where combined with $where by the builder's combine_where. Croaks, pointing to where, when the handle has no where or an empty one.

$h2 = $h->_join(\@frame, $method, $table, %opts)

The handle over its source with one more joined table, making a join from a table source first. Link errors report at @frame, the public method's caller frame.

$h2 = $h->_run_mode($mode)
$h2 = $h->_run_mode($mode, $maybe)

The handle with the mode set. Without $maybe it croaks with _cannot_run's reason. With it, a mode that cannot run leaves the mode as it was, but the handle is still a new one.

$reason = $h->_cannot_run($mode)

Why the mode cannot run, or undef when it can: the database has no async queries, or the mode needs a second connection and none can reach the database or the ORM was given a dbh.

\%pending = $h->_aside($conn, $source, $sql, \@binds)

Starts the query as an async one on a new Connection like $conn, and returns its pending code references, closing that connection once it is collected or cancelled. The code references hold the ORM, not the handle.

\%pending = $h->_forked($conn, $source, $sql, \@binds)

Forks a child that runs the query on a new Connection like $conn, writes one message, and leaves through POSIX::_exit on every path, so nothing it inherited is destroyed there.

The message is a Storable freeze of {rows => \@rows} or {error => $message}. It is not nfreeze, which keeps no more than 15 significant digits of a float. ready reads without blocking, collect blocks, and cancel kills and reaps the child.

$code = $h->_results

A code reference turning fetched rows into (\@rows, \&build) for an iterator, given the rows: through the source's results, ingesting them unless the handle is no_cache, or as computed rows. It holds the ORM and the source, not the handle, so a pending iterator kept in the handle makes no cycle.

%request = $h->_select_request

The builder's select request: the handle's settings (the where through _where_request), with the primary key added to fields, or the source's default fields. For computed rows, each column's expression under its name.

%request = $h->_where_request

The where and where_builders for a builder request: the handle's where builders, or the ORM's. Empty without a where.

$bool = $h->_computed

True when the handle yields computed rows.

$bool = $h->_fields_ok($value)

True for what fields takes: an arrayref of field names, or a non-empty hashref (its columns are checked by _columns).

\%columns = $h->_columns

The computed columns, built once per handle: each name mapped to its field record (as DBIx::QuickORM::AggregateRow takes columns) plus expr, a field name, an sql() marker, or [$FUNC, $field] ($field may be *). A record's name is the column's, and its table the source's table, absent when it has none. Without a fields hashref, the grouped or listed fields each name themselves. Croaks when having has neither.

\%column = $h->_column($name, $spec, \%like)

One column of _columns. %like holds the lowercased names of the aggregate functions that keep the field's facts.

%facts = $h->_field_facts($name, $field)

The field's record from the map (orm_type, db_type, type, size, affinity, as it has them) and its single-field foreign keys as fk, for the column $name. Croaks when the field is not a field of the source. A query source knows no fields, so a name passes unchecked with no facts.

\%fk = $h->_column_fk($name, $fk)

An fk given for column $name (a table, [$table, $field], or {$table => $field}) as {$table => [{$name => $field}]}. Croaks when its table or field is not in the map, or a bare table's primary key is not one field.

$bool = $h->_is_name($value)

True for a defined, non-empty plain string.

$bool = $h->_is_sql($value)

True for an sql() marker.

@args = $h->_row_class_arg

The handle's row class as named arguments, (row_class => $class), when one was set (even to undef), or an empty list when none was. The ORM's _row, _row_builder, CRUD calls, and a source's results take it as their row_class option.

$row = $h->_row(\%data)

The row data built into a row as the handle builds rows, or undef for undef.

$table = $h->_table($action)

The source's table. Croaks naming the action for a source without one.

$table = $h->_bulk_table($action)
$table = $h->_row_table($action)

The table, after croaking for the settings the action cannot honor.

SOURCE

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

MAINTAINERS

Chad Granum <exodist7@gmail.com>

AUTHORS

Chad Granum <exodist7@gmail.com>

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/