Alzabo...tHandle(3pm)
π Alzabo::Runtime::InsertHandle π
okay bestie, welcome to the Alzabo::Runtime::InsertHandle page β that's the Perl manual situation (the 3pm one, you know the vibe) π
It's literally a handle representing an insert. That's the whole name, that's the whole job. iconic β¨
πΈ SYNOPSIS πΈ
here's the whole flex, verbatim, no edits, don't touch a character:
my $handle =
$table->insert_handle
( columns => [ $table->columns( 'name', 'job' ) ] );
my $faye_row =
$handle->insert( values =>
{ name => 'Faye',
job => 'HK Pop Chanteuse' } );
my $guesch_row =
$handle->insert( values =>
{ name => 'Guesch',
job => 'French Chanteuse and Dancer' } );
look at her go π two rows, one handle, zero drama.
π¦ DESCRIPTION π¦
so this object is analogous to a DBI statement handle β you know, the way that a DBI statement handle lets you do the same thing over and over without re-preparing? yeah. same energy, different Alzabo.
and the point of it? you can use it to insert multiple rows into a table more efficiently than repeatedly calling:
Alzabo::Runtime::Table->insert()
like, if you're out here calling insert() in a loop, bestie, stop π this handle is the glow-up. periodt. π₯
β¨ METHODS β¨
objects of this class provide one public method. just one. she's not complicated, she's focused. π
π insert
This method is used to insert a new row into a table. that's it, that's the whole thing, she ate π
It accepts the following parameters:
valuesβ this should be a hash reference containing the values to be inserted into the table. like, the actual data, the receipts, the content π
okay so here's where it gets kinda detailed and you need to actually pay attention:
If no value is given for a primary key column and the column is "sequenced" then the primary key will be auto-generated for you. the handle gotchu π«Ά
If values are not provided for other columns which were given when Alzabo::Runtime::Table->insert_handle was called, this method first checks to see if a value was provided for the column when Alzabo::Runtime::Table->insert_handle was called. And if none was provided? then the column's default value is used. fallback queen β¨
If column values were passed to Alzabo::Runtime::Table->insert_handle, then these can be overridden by values passed to this method. mix and match, customize your fit π
IMPORTANT WARNING TIME π¨ It is not possible to override column values that were given as SQL functions when Alzabo::Runtime::Table->insert_handle was called. nope. can't do it. SQL functions said "I'm built different" and they meant it. π
This method returns a new Alzabo::Runtime::Row object. a whole new row, freshly spawned, main character energy π
Throws: Alzabo::Exception::Logic, Alzabo::Exception::Params
so like, if you mess up the params or the logic, she will absolutely throw hands (exceptions). be normal about it. π
okay that's the whole page bestie, you're basically an Alzabo girlie now, go insert some rows efficiently πβ¨π
this was Perl v5.34.0, dated 2022-06-14, brought to you by the User Contributed Perl Documentation situation β mwah, love u, bye π«Άπ·
π¦ where this page comes from
- debian bookworm: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms