NAME

Data::TagDB::Interface::Plugin - Work with Tag databases, plugin base package

VERSION

version v0.14

SYNOPSIS

use Data::TagDB::Interface::Plugin; # See notes below

(experimental since v0.14)

Note: Modules will "use" in perlfunc this module and not use parent as one would expect. This is due to this module performing some early registration that is impossible with parent. This module's import() will make the package using this one also inherit from it.

METHODS

plugin_attach

my $info = My::Plugin->plugin_attach($db, $conf, %opts);

(experimental since v0.14)

This method is called by the database to attach the plugin to a database.

The method is passed a configuration ($conf) that is specific to the plugin or undef.

The method must return a hashref to an information structure as used by the database to talk to the plugin. The database module might write to the plugin structure (so it cannot be read-only) but will do so only in ways that allow it to be reused (so it is safe to store the info structure in a global or state variable).

This method MUST NOT write to the database. If a plugin requires data to be present in the database it should document that and provide it in a way supported by Data::TagDB::Migration.

This method may die on error. This will not corrupt the state of the database or the database handle.

If the plugin requires to state information it MUST NOT do this via global or state variables. It can however use "userdata" in Data::Identifier::Interface::Userdata on the provided database handle.

The default implementation will return an empty information structure.

FURTHER DIRECTIONS

FUTURE METHODS

To be future-safe this interface reserves the following methods: new, plugin_*, _*_provider.

Also the methods used and/or reserved by Data::Identifier::Interface::Simple, Data::Identifier::Interface::Known, Data::Identifier::Interface::Subobjects, and Data::Identifier::Interface::Userdata are reserved to be used by those interfaces.

AUTHOR

Philipp Schafft <lion@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2024-2026 by Philipp Schafft <lion@cpan.org>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)