DBIx::...iokuDB(3pm)
π DBIx::Class::KiokuDB π
okay so bestie, this is a Perl manual page (the 3pm kind, module docs, you know the vibe) and it's literally called DBIx::...iokuDB in the header, but the actual NAME is DBIx::Class::KiokuDB β the header just got its nails done and cut off, we don't ask questions β¨
πΈ NAME πΈ
DBIx::Class::KiokuDB β refer to KiokuDB objects from DBIx::Class tables. it's giving "your DB tables can point at your KiokuDB objects" and honestly? iconic.
π VERSION π
version 1.23 β yes queen, she's got a number π
β¨ SYNOPSIS β¨
okay so go look at DBIx::Class::Schema::KiokuDB, that's the whole vibe. but here's the tea:
package MyApp::DB::Result::Album;
use base qw(DBIx::Class);
__PACKAGE__>load_components(qw(Core KiokuDB));
__PACKAGE__->table('album');
__PACKAGE__->add_columns(
id => { data_type => "integer" },
title => { data_type => "varchar" },
# the foreign key for the KiokuDB object:
metadata => { data_type => "varchar" },
);
__PACKAGE__->set_primary_key('id');
# enable a KiokuDB rel on the column:
__PACKAGE__->kiokudb_column('metadata');
no cap, that's the whole setup π«Ά
π¦ DESCRIPTION π¦
so this DBIx::Class component hands you the code you need so that DBIx::Class::Row objects can refer to KiokuDB objects β and those objects live in KiokuDB::Backend::DBI. it's a lil bridge between your two worlds and the way that it just works?? obsessed. π
π CLASS METHODS π
kiokudb_column $relβ declares a relationship to any KiokuDB object, periodt. and heads up: in future versions, adding relationships to different sub-collections will be possible too. so like, watch this space, lowkey exciting π
π METHODS π
storeβ a convenience method, bestie. it calls"store" in KiokuDBon all the referenced KiokuDB objects, and then it invokes"insert_or_update"on$self. two steps, one method, we love efficiency β¨get_kiokudb_column $colset_kiokudb_column $col, $objstore_kiokudb_column $col, $objβ these three? go seeDBIx::Class::Row. iykyk π
π₯ OVERRIDDEN METHODS π₯
newβ recognizes objects passed in as column values, much like standard relationships do. main character behaviour fr fr.insertβ also calls"insert" in KiokuDBon all referenced objects that are not in the KiokuDB storage. it goes and fetches the stragglers πupdateβ adds a check to make sure that all referenced KiokuDB objects are in storage. like a bouncer at the club, nobody gets in unverified π
πΈ AUTHOR πΈ
Yuval Kogman <nothingmuch@woobling.org> β the author, the icon, the legend π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie!! π«Ά this was generated from perl v5.34.0, dated 2022-05-24, and yes the footer says DBIx::...iokuDB(3pm) again because she's shy and keeps truncating her own name π slay, bye!! πβ¨π
π¦ where this page comes from
- debian bookworm: libkiokudb-backend-dbi-perl 1.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libkiokudb-backend-dbi-perl 1.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libkiokudb-backend-dbi-perl 1.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libkiokudb-backend-dbi-perl 1.23-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libkiokudb-backend-dbi-perl 1.23-3 Β· 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