LuaNoSQL is a simple no-ffi-based interface from Lua to NoSQL DBMS (UnQLite, Vedis...)
LuaNoSQL is a simple interface from Lua to NoSQL DBMS (heavily inspired by LuaSQL & LuaSQLite3). This implementation is NOT based on FFI library.
It enables a Lua program to:
- Connect to UnQLite, Vedis (not supported yet) databases;
- Execute arbitrary key/value operations;
- Manage data using cursors.
Version 1.0.0 is the first official release and it supports UnQLite DB only.
JX9 Document Store functions for UnQLite are currently not supported (in development)
LuaNoSQL version 1.0.0 (for Lua 5.1 and 5.2) is now available. It can be compiled under Linux and OS X with current Makefile. It should also work in Windows OSes but a custom Makefile should be added.
LuaNoSQL depends on Lua 5.x and on the corresponding database library (UnQLite, Vedis,...). You can compile it from sources under Linux or OS X with GCC compiler.
Check in Makefile that installation folder is correct for your linux or OS X system. To install LuaNoSQL:
- To compile it, go to LuaNoSQL folder and type:
make lib
- Then, to install it, type:
make install
You are done! You can use it
Here a simple example on how to use LuaNoSQL with UnQLite driver. For feature list and supported functions check the documentation.
-- load driver
driver = require"luanosql.unqlite"
-- create environment object
env = driver.unqlite()
-- connect to unqlite data source
con = env:connect("luaunqlite-test")
-- insert a key/value element
res = con:kvstore("key1","Hello World!")
-- retrieve data
res, data = con:kvfetch("key1")
print("Data for key1 = ", data)
In tests folder you can see some examples and tests. Tests are written using lua telescope and can be run from bash:
tsc -f tests/unqlite_teletests.lua
LuaNoSQL is free software and uses the same license as Lua 5.1.
Version 1.1.0:
- JX9 DOC STORE API: expose document store functions for built-in JX9 engine
Version 1.2.0:
- Vedis Driver: an interface for Vedis NoSQL DBMS