diff --git a/Changes b/Changes index fb8ef47..ad21f65 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,12 @@ Revision history for Perl extension Unqlite {{$NEXT}} +0.03 2013-07-18T03:14:07Z + + - more OPEN consts as mode argument + we do not only want to create databases + (Reini Urban) + 0.02 2013-07-05T06:42:59Z - Store RC to magic to fix race condition diff --git a/META.json b/META.json index a49c33f..d104f75 100644 --- a/META.json +++ b/META.json @@ -63,8 +63,9 @@ "web" : "https://github.com/tokuhirom/UnQLite" } }, - "version" : "0.02", + "version" : "0.03", "x_contributors" : [ - "Kenichi Ishigaki " + "Kenichi Ishigaki ", + "Reini Urban " ] } diff --git a/README.md b/README.md index 1286c87..44bad80 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ UnQLite - Perl bindings for UnQLite use UnQLite; - my $db = UnQLite->open('foo.db'); + my $db = UnQLite->open('foo.db', UNQLITE_OPEN_READWRITE|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'; + tie my %hash, 'UnQLite', 'foo.db', UNQLITE_OPEN_READWRITE; $hash{foo} = 'bar'; say $hash{foo}; # => bar @@ -35,6 +35,17 @@ __You can use UnQLite.pm as DBM__. Open the database. + Modes: + + UNQLITE_OPEN_CREATE (Default) + UNQLITE_OPEN_READONLY + UNQLITE_OPEN_READWRITE + UNQLITE_OPEN_EXCLUSIVE + UNQLITE_OPEN_TEMP_DB + UNQLITE_OPEN_OMIT_JOURNALING + UNQLITE_OPEN_IN_MEMORY + UNQLITE_OPEN_MMAP + - `$db->kv_store($key, $value);` Store the entry to database. diff --git a/lib/UnQLite.pm b/lib/UnQLite.pm index 9efb43b..6ba7b52 100644 --- a/lib/UnQLite.pm +++ b/lib/UnQLite.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Carp (); -our $VERSION = "0.02"; +our $VERSION = "0.03"; our $rc = 0; use XSLoader;