DOKK / manpages / debian 12 / libkiokudb-backend-dbi-perl / DBIx::Class::KiokuDB.3pm.en
DBIx::Class::KiokuDB(3pm) User Contributed Perl Documentation DBIx::Class::KiokuDB(3pm)

DBIx::Class::KiokuDB - Refer to KiokuDB objects from DBIx::Class tables.

version 1.23

See DBIx::Class::Schema::KiokuDB.

    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');

This DBIx::Class component provides the code necessary for DBIx::Class::Row objects to refer to KiokuDB objects stored in KiokuDB::Backend::DBI.

Declares a relationship to any KiokuDB object.

In future versions adding relationships to different sub-collections will be possible as well.

A convenience method that calls "store" in KiokuDB on all referenced KiokuDB objects, and then invokes "insert_or_update" on $self.
See DBIx::Class::Row.

Recognizes objects passed in as column values, much like standard relationships do.
Also calls "insert" in KiokuDB on all referenced objects that are not in the KiokuDB storage.
Adds a check to ensure that all referenced KiokuDB objects are in storage.

Yuval Kogman <nothingmuch@woobling.org>

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.

2022-05-24 perl v5.34.0