MATSUNO★Tokuhiro > UnQLite-0.01 > UnQLite



Annotate this POD


View/Report Bugs
Module Version: 0.01   Source   Latest Release: UnQLite-0.03


UnQLite - Perl bindings for UnQLite


    use UnQLite;

    my $db = UnQLite->open('foo.db');
    $db->kv_store('foo', 'bar');
    say $db->kv_fetch('foo'); # => bar
    undef $db; # close database


UnQLite is a in-process software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL database engine. UnQLite is a document store database similar to MongoDB, Redis, CouchDB etc. as well a standard Key/Value store similar to BerkeleyDB, LevelDB, etc.

This module is Perl5 binding for UnQLite.

If you want to know more information about UnQLite, see

This version of does not provides document store feature. Patches welcome.

You can use as DBM.


my $db = UnQLite->open('foo.db'[, $mode]);

Open the database.

$db->kv_store($key, $value);

Store the entry to database.


Fetch data from database.


Delte $key from database.


Return code from UnQLite. It may updates after any UnQLite API call.


This API returns stringified version of $db->rc(). It's not human readable but it's better than magic number.

my $cursor = $db->cursor_init()

Create new cursor object.

UnQLite::Cursor ^

UnQLite supports cursor for iterating entries.

Here is example code:

    my $cursor = $db->cursor_init();
    my @ret;
    for ($cursor->first_entry; $cursor->valid_entry; $cursor->next_entry) {
        push @ret, $cursor->key(), $cursor->data()



Seek cursor to first entry.

Return true if succeeded, false otherwise.


Seek cursor to last entry.

Return true if succeeded, false otherwise.


This will return 1 when valid. 0 otherwise


Get current entry's key.


Get current entry's data.


Seek cursor to next entry.


Seek cursor to previous entry.

Return true if succeeded, false otherwise.

$cursor->seek($key, $opt=UNQLITE_CURSOR_MATCH_EXACT)

Seek cursor to $key .

You can specify the option as $opt . Please see for more details.

Return true if succeeded, false otherwise.


Delete the database entry pointed by the cursor.

Return true if succeeded, false otherwise.


Copyright (C) tokuhirom.

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


tokuhirom <>

syntax highlighting: