Jakob Voß > PICA-Record-0.584 > PICA::SQLiteStore

Download:
PICA-Record-0.584.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.584   Source   Latest Release: PICA-Record-0.585

NAME ^

PICA::SQLiteStore - Store PICA::Records in a SQLite database with versioning

VERSION ^

version 0.584

METHODS ^

new ( [ SQLite => ] $filename [, %params ] )

Create a new or connect to an existing SQLite database.

get ( $id [, $version ] )

Retrieve the latest revision of record or a specific version. Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id', 'record' (a PICA::Record object), 'version', and 'timestamp'.

create ( $record )

Insert a new record. The parameter must be a PICA::Record object. Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id', 'record', 'version', and 'timestamp'.

update ( $id, $record [, $version ] )

Update a record by ID, updated record (of type PICA::Record), and version (of a previous get, create, or update command).

Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id', 'record', 'version', and 'timestamp'.

The version parameter is ignore so far (this will be changed).

delete ( $id )

Delete a record by ID.

Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id'.

access ( $key => $value, ... )

Set general access parameters (userkey, password, dbsid and/or language). Returns the store itself so you can chain anothe method call.

Any client that wants to access should first set these parameters and then perform the actual access method (create, get, update, delete...).

Up to now only the userkey parameters is used.

history ( $id, $offset, $limit )

Return the version history of a given record.

prevnext ( $id, $version [, $limit ] )

Get previous and next revisions of a given record version. Returns a hash reference indexed by version id.

recentchanges ( $offset, $limit )

Get a list of recent changes as array of hashref. Deleted records are included.

contributions ( $user, $offset, $limit )

Get a list of contributions of a user as array of hashref. Deleted records are included.

deletions ( $offset, $limit )

Get a list of deleted records.

DESTROY (destructor)

Disconnect the database before exit. This method is only called automatically as destructor, so don't call it explicitely!

AUTHOR ^

Jakob Voß <voss@gbv.de>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Verbundzentrale Goettingen (VZG) and Jakob Voss.

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

syntax highlighting: