DBIx::...iokuDB(3pm)

πŸ“¦
version 1.23 Β· 2 versions
  • 1.23 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.23 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 KiokuDB on all the referenced KiokuDB objects, and then it invokes "insert_or_update" on $self. two steps, one method, we love efficiency ✨
  • get_kiokudb_column $col
  • set_kiokudb_column $col, $obj
  • store_kiokudb_column $col, $obj β€” these three? go see DBIx::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 KiokuDB on 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 πŸ’–


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