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

Download:
PICA-Record-0.583.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.21   Source   Latest Release: PICA-Record-0.585

NAME ^

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

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 Voss <jakob.voss@gbv.de>

LICENSE ^

Copyright (C) 2007-2009 by Verbundzentrale Goettingen (VZG) and Jakob Voss

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: