• Stars
    star
    9
  • Rank 1,939,727 (Top 39 %)
  • Language
    C
  • License
    Other
  • Created over 11 years ago
  • Updated almost 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Perl5 bindings for Unqlite.

NAME

UnQLite - Perl bindings for UnQLite

SYNOPSIS

use UnQLite;

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

# tie interface
tie my %hash, 'UnQLite', 'foo.db', UnQLite::UNQLITE_OPEN_READWRITE;
$hash{foo} = 'bar';
say $hash{foo}; # => bar

DESCRIPTION

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 http://unqlite.org/.

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

You can use UnQLite.pm as DBM.

METHODS

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

    Open the database.

    Modes:

      UnQLite::UNQLITE_OPEN_CREATE      (Default)
      UnQLite::UNQLITE_OPEN_READONLY
      UnQLite::UNQLITE_OPEN_READWRITE
      UnQLite::UNQLITE_OPEN_EXCLUSIVE
      UnQLite::UNQLITE_OPEN_TEMP_DB
      UnQLite::UNQLITE_OPEN_OMIT_JOURNALING
      UnQLite::UNQLITE_OPEN_IN_MEMORY
      UnQLite::UNQLITE_OPEN_MMAP
    
  • $db->kv_store($key, $value);

    Store the entry to database.

  • $db->kv_fetch($key);

    Fetch data from database.

  • $db->kv_delete($key);

    Delte $key from database.

  • $db->rc();

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

  • $db->errstr()

    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()
}

METHODS

  • $cursor->first_entry()

    Seek cursor to first entry.

    Return true if succeeded, false otherwise.

  • $cursor->last_entry()

    Seek cursor to last entry.

    Return true if succeeded, false otherwise.

  • $cursor->valid_entry()

    This will return 1 when valid. 0 otherwise

  • $cursor->key()

    Get current entry's key.

  • $cursor->data()

    Get current entry's data.

  • $cursor->next_entry()

    Seek cursor to next entry.

  • $cursor->prev_entry()

    Seek cursor to previous entry.

    Return true if succeeded, false otherwise.

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

    Seek cursor to $key.

    You can specify the option as $opt. Please see http://unqlite.org/c_api/unqlite_kv_cursor.html for more details.

    Return true if succeeded, false otherwise.

  • $cursor->delete_entry()

    Delete the database entry pointed by the cursor.

    Return true if succeeded, false otherwise.

LICENSE

Copyright (C) tokuhirom.

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

AUTHOR

tokuhirom [email protected]

More Repositories

1

plenv

Perl binary manager
Shell
500
star
2

Amon

yet another web application framework
Perl
160
star
3

java-handbook

137
star
4

git-xlsx-textconv

Go
132
star
5

akaza

Yet another Japanese IME for IBus/Linux
Rust
127
star
6

Furl

pretty fast http client library for perl5
Perl
103
star
7

Minilla

Authorizing tool for CPAN modules
Perl
97
star
8

Perl-Build

Perl
79
star
9

spring-vue-sample

Java
71
star
10

p6-Crust

PSGI library stack for Perl6
Raku
66
star
11

node-perl

Node perl wrapper
C++
63
star
12

toydi

Java
63
star
13

cpan-outdated

detect outdated CPAN modules
Perl
52
star
14

tora

Tora! Tora! Tora!
Perl
51
star
15

avans

Tiny thin web application framework for Java 8
Java
50
star
16

js-xlsx-demo

JavaScript
50
star
17

SQL-Maker

Perl
47
star
18

jawiki-kana-kanji-dict

Generate SKK/MeCab dictionary from Wikipedia(Japanese edition)
Python
40
star
19

node-mruby

C++
40
star
20

Daiku

Yet another build tool on Perl5
Perl
38
star
21

teng-handbook

Perl
38
star
22

mobirc

IRC Gateway for MobilePhone/iPhone/PC
JavaScript
33
star
23

Test-TCP

Test::TCP for perl
Perl
33
star
24

jsref

JavaScript
33
star
25

re2c-lemon-tutorial

C++
32
star
26

p5-router-simple

simple http router
Perl
32
star
27

tinyorm

Tiny O/R mapper for Java
Java
29
star
28

p5-psgiref

(DEPRECATED)just a prototype!
Perl
28
star
29

Web-Query

Perl
27
star
30

OrePAN

Perl
26
star
31

obsidian-2hop-links-plugin

TypeScript
26
star
32

optimize-perl-doc

how to optimize your perl code?
Perl
26
star
33

frepan

freshness mirror of cpan viewer
JavaScript
25
star
34

strftime-js

JavaScript
25
star
35

menta

General extlib/ for CGI applications.
Perl
25
star
36

PJP

Perl
24
star
37

micro_dispatcher.js

JavaScript
22
star
38

data-model-tutorial

the tutorial documents for Data::Model
Perl
22
star
39

OrePAN2

Perl
22
star
40

hoshipad

JavaScript
22
star
41

FormValidator-Lite

very lite and fast validation library for perl
Perl
21
star
42

go-examples

my Golang examples repo.
Go
21
star
43

THWebViewController

Minimalistic WebViewController
Objective-C
20
star
44

go-hsperfdata

Quite fast jps/jstat
Go
20
star
45

Test-Pretty

Perl
20
star
46

p5-http-server-fast

(DEPRECATED)
C++
18
star
47

p6-HTTP-Server-Tiny

Web application server for Perl6
Perl 6
18
star
48

gearman-stat.psgi

Display gearman stats.
18
star
49

visualwidth-js

JavaScript
18
star
50

Router-Boom

Perl
18
star
51

obsidian-pomodoro-plugin

TypeScript
17
star
52

Archer

Perl
17
star
53

nanobench

Tiny benchmarking framework for Java 7+
Java
17
star
54

nanowww

C++ lightweight, fast, portable HTTP client library
Perl
17
star
55

mouse

Moose minus the antlers
Perl
16
star
56

www-mobilecarrierjp

WWW::MobileCarrierJP
Perl
16
star
57

http-session

http session management library for perl
Perl
16
star
58

HTML-TreeBuilder-LibXML

drop-in-replacement for HTML::TreeBuilder::XPath
Perl
16
star
59

Tiffany

Template-For-All, Generic interface for perl template engines.
Perl
16
star
60

DBIx-Inspector

Perl
16
star
61

w3m

my private repo of w3m
C
15
star
62

File-Zglob

Perl
15
star
63

madeye

simple infrastructure monitoring tool
Perl
15
star
64

Smart-Args

the new args.pm!
Perl
15
star
65

Test-Kantan

Perl
14
star
66

Caroline

Yet another line editing library for Perl5
Perl
14
star
67

p5-net-drizzle

libdrizzle bindings for perl5
C
14
star
68

perl-echo-servers

C
14
star
69

gearman-starter.pl

bootstrap script for gearman worker
Perl
13
star
70

MySQL-BinLog

Perl
13
star
71

obsidian-stopwatch-plugin

TypeScript
13
star
72

MetaCPANExplorer

CSS
13
star
73

node-tcc

C++
13
star
74

HTML-Pictogram-MobileJp

[emoji:1] ใฟใŸใ„ใชใฎใ‚’ๅ‡ฆ็†ใงใใ‚‹ไบบ
Perl
13
star
75

App-watcher

Perl
13
star
76

tinyvalidator

Tiny validation library for Java 8
Java
13
star
77

Text-Markdown-Hoedown

Perl
13
star
78

java-samples

Java
12
star
79

nanotap

yet another tap header library
HTML
12
star
80

App-scan_prereqs_cpanfile

Scan prerequisite modules and generate CPANfile
Perl
12
star
81

MojaMoja

(PoC)yet another sinatra-ish framework built on CPAN modules
Perl
12
star
82

Test-SharedFork

Test::SharedFork
Perl
12
star
83

p5-cgi-emulate-psgi

CGI::Emulate::PSGI
Perl
11
star
84

p5-anyevent-mprpc

MessagePack RPC component for AnyEvent!
Perl
11
star
85

mRuby.pm

Perl
11
star
86

devel-bindpp

Devel::BindPP makes writing perl extension easily
C++
11
star
87

Test-Power

Perl
11
star
88

regexp-trie

Regexp::Trie for Java7
Java
11
star
89

Sub-Retry

Perl
11
star
90

blosxom.psgi

cho45 style blosxom thing for psgi. see http://coderepos.org/share/wiki/BlosxomClones
10
star
91

cgi-extlib-perl

General extlib/ for Perl CGI applications.
Perl
10
star
92

p5-module-install-forc

M::I extension for standalone C program/library
Perl
10
star
93

DBIx-Kohada

Perl
10
star
94

Amon2-Lite

Perl
10
star
95

autolink.js

JavaScript
10
star
96

Module-Spy

Perl
10
star
97

p6-WebSocket

Perl 6
10
star
98

Harriet

Perl
10
star
99

Cache-KyotoTycoon

KyotoTycoon client library for Perl5
Perl
10
star
100

mindcheese

Editable mindmap library written in TypeScript
TypeScript
10
star