Zakariyya Mughal

NAME

Biblio::Zotero::DB::Role::CopyDB - A role to copy the database to a temporary file.

VERSION

version 0.002

SYNOPSIS

  use Biblio::Zotero::DB;
  use Moo::Role;

  $db = Biblio::Zotero::DB->new();
  Moo::Role->apply_roles_to_object($db, 'Biblio::Zotero::DB::Role::CopyDB');
  $db->schema; # this will use a copy of the database file

DESCRIPTION

It is likely to that you might have Zotero open while using Biblio::Zotero::DB. This causes problems as the database file will be locked as long as Zotero is running. To get around that, applying this role will create a copy whenever the schema attribute of Biblio::Zotero::DB is built.

ATTRIBUTES

db_file_temp

A string that is used to determine where to store the copy of the database file. By default, this is built as a File::Temp.

  • This must be a writable file or retrieving the schema will die.

  • This can be cleared using the method clear_db_file_temp.

AUTHOR

Zakariyya Mughal <zmughal@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Zakariyya Mughal.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.