Skip to content

LGMAM/tarantool-lua

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tarantool-lua: Tarantool Connector for Lua

Tarantool connector for Lua.

It Supports luajit, lua5.2 and lua5.1

Everything is simple:

Connection = require("tarantool")
def_schema = {
    spaces = {
        [0] = {
            fields = {'string', 'number32', 'number64'},
            indexes = {
                [0] = {0},
                [1] = {1},
                [2] = {0, 1, 2},
            },
        },
        [1] = {
            ...
        },
    },
    funcs = {
        'box.time64' = {
            ['in'] = {},
            ['out'] = {'number64'}
        },
        'another stored procedur' = {
            ...
        },
    },
} -- it's just an example. Schema may be smaller, simpler and more beautiful. 

new_con = Connection{host = "127.0.0.1", port=33013, timeout=10, schema=def_schema}
new_con:insert(0, {'hello', 123, 123456})
new_con:insert(0, {'hello_1', 123, 1234567})
new_con:select(0, 1, 'hello')

You may install this library with luarocks:

# latest (unstable) version
$ wget https://raw.github.com/bigbes92/tarantool-lua/master/rocks/tarantool-latest-1.rockspec
# latest (stable) version
$ wget https://raw.github.com/bigbes92/tarantool-lua/master/rocks/tarantool-0.0.1-1.rockspec
$ luarocks install tarantool-{VERSION}.rockspec --local

Indices and tables

  • genindex
  • search

About

Tarantool connector for Lua

Resources

License

Stars

Watchers

Forks

Packages

No packages published