---
name: "DBIx::Class::KiokuDB"
section: "3pm"
platform: "linux"
package: "libkiokudb-backend-dbi-perl"
version: "1.23-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/DBIx::Class::KiokuDB"
---

# DBIx::Class::KiokuDB(3pm)

Refer to KiokuDB objects from DBIx::Class tables.

## NAME

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

## VERSION

version 1.23

## SYNOPSIS

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

## DESCRIPTION

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

## CLASS METHODS

- kiokudb\_column $rel

  Declares a relationship to any KiokuDB object.

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

## METHODS

- store

  A convenience method that calls "store" in KiokuDB on all referenced KiokuDB objects, and then invokes `"insert_or_update"` on `$self`.

- get\_kiokudb\_column $col

  - set\_kiokudb\_column $col, $obj

  - store\_kiokudb\_column $col, $obj

  See DBIx::Class::Row.

## OVERRIDDEN METHODS

- new

  Recognizes objects passed in as column values, much like standard relationships do.

- insert

  Also calls "insert" in KiokuDB on all referenced objects that are not in the KiokuDB storage.

- update

  Adds a check to ensure that all referenced KiokuDB objects are in storage.

## AUTHOR

Yuval Kogman \<nothingmuch@woobling.org\>

## 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.
