我實作了
UnQLite 一部份的 Database Engine Handle, Key/Value Store Interfaces, Cursor Iterator Interfaces 與 Manual Transaction Manager 功能。
UnQLite 的儲存方式有二種,一種是 key-pair,一種是 JSON 文件。目前我已經實作了一部份 key-pair 方式的功能。
這是一個嘗試實作的 draft 版本,我有寫一些簡單的測試檔案進行測試目前實作的部份,不過因為沒有大量測試,所以請不要用在需要高可靠度的環境。
檔案放置網頁
Tclunqlite
About
This is the
UnQLite extension for Tcl using the Tcl Extension Architecture (TEA).
UnQLite is a in-process software library which implements a self-contained, serverless,
zero-configuration, transactional NoSQL database engine.
This extension provides an easy to use interface for accessing UnQLite database files from Tcl.
License and version
BSD license, v0.1 (draft version)
UNIX BUILD
Building under most UNIX systems is easy, just run the configure script
and then run make. For more information about the build process, see
the tcl/unix/README file in the Tcl src dist. The following minimal
example will install the extension in the /opt/tcl directory.
$ cd tclunqlite
$ ./configure --prefix=/opt/tcl
$ make
$ make install
WINDOWS BUILD
The recommended method to build extensions under windows is to use the
Msys + Mingw build process. This provides a Unix-style build while
generating native Windows binaries. Using the Msys + Mingw build tools
means that you can use the same configure script as per the Unix build
to create a Makefile.
Implement commands
Basic usage
unqlite DBNAME FILENAME ?-readonly BOOLEAN? ?-mmap BOOLEAN? ?-create BOOLEAN? ?-in-memory BOOLEAN? ?-nomutex BOOLEAN?
DBNAME close
DBNAME config ?-disableautocommit BOOLEAN?
Key/value features
DBNAME kv_store key value
DBNAME kv_append key value
DBNAME kv_fetch key
DBNAME kv_delete key
Transactions
DBNAME begin
DBNAME commit
DBNAME rollback
Cursors
DBNAME cursor_init CURSORNAME
CURSORNAME seek
CURSORNAME first
CURSORNAME last
CURSORNAME next
CURSORNAME prev
CURSORNAME isvalid
CURSORNAME getkey
CURSORNAME getdata
CURSORNAME delete
CURSORNAME reset
CURSORNAME release
Misc
DBNAME random_string buf_size
DBNAME version