NAME

Data::TagDB::Migration - Work with Tag databases

VERSION

version v0.06

SYNOPSIS

use Data::TagDB;

my Data::TagDB $db = Data::TagDB->new(...);
$db->migration->upgrade;

use Data::TagDB::Migration;
my Data::TagDB $db = Data::TagDB::Migration->create(...);

Create with or upgrade database to current schema.

METHODS

upgrade

$db->migration->upgrade;

Upgrade database to current schema. Also ensures all required base objects are present.

create

my Data::TagDB $db = Data::TagDB::Migration->create(...);

Creates a database and returns an handle to it. This function takes the same arguments as "new" in Data::TagDB.

db

my Data::TagDB $db = $migration->db;

Returns the current Data::TagDB object.

dbh

my $dbh = $migration->dbh;

Returns the current DBI connection.

include

$migration->include(...);
# e.g:
$migration->include('Data::TagDB::WellKnown', ...);
# same as:
$migration->include({source => 'Data::TagDB::WellKnown'}, ...);
# or:
$migration->include({source => 'xxx', %opts}, ...);
# e.g.:
$migration->include({source => 'file', filename => 'xxx'}, ...);

Includes data from a given source.

Currently supported sources: Data::TagDB::WellKnown, Data::URIID, Data::Identifier, any package implementing Data::Identifier::Interface::Known, file, and directory.

Note: This function should be called inside a transaction (see "begin_work" in Data::TagDB). Runing this inside a transaction will result in a speedup often ranging between 10 and 100 times. It is safe to mix this function with any other function within a single transaction.

If the source is file the following options are supported:

filename

The name of the file to read. Required if handle is not given.

handle

The handle to read from. Must allow seeking. Required if filename is not given.

skip_unsupported

Skip known but unsupported directives. Which directives are supported depend on the format being read.

The directory source supports the same options as the file source but handle. It will recursivly search the directory for usable files. Files not matching the standard format will be skipped.

For the tagpool-source-format the following directives are supported:

Modern

tag-ise, tag-metadata, tag-relation.

Legacy

tag, tag-type, tag-owner, tag-implies (only non-filter form), tag-suggests (only non-filter form), tag-replaced-by, tag-generated-by, tag-links, tag-description, tag-generator-request, tag-description-uri, tag-mark-important, tag-remove, tag-mark-no-direct.

Known but unsupported

source-default-mark-important, source-default-mark-no-direct, source-default-type, source-default-owner, source-default-implies, tag-oid, tag-generator, tag-generator-hint.

AUTHOR

Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2024 by Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)