PostgreSQL native library for Tarantool programming language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
annelin d962ba8fa1 Update README 2 months ago
cmake Try to fix OpenSSL cmake recipe 10 months ago
tarantool_psql Fixed path in driver 5 months ago
CMakeLists.txt Library renamed to tarantool_psql 5 months ago
LICENSE Import from 1 year ago Update README 2 months ago
tarantool-psql-git-999.rockspec Rockspec location 5 months ago

pg-tarantool - PostgreSQL connector for Tarantool

Getting Started


  • Tarantool 1.10+ with headers (tarantool && tarantool-dev packages)
  • PostgreSQL 9.1+ headers (libpq-dev package)
  • OpenSSL headers (libssl-dev package)
  • libuuid headers (uuid-dev package)
  • Recommended: lua-cjson and lpeg


Clone repository and then build it using CMake:

git clone
cd pg-tarantool && cmake . 
make install

You can also use LuaRocks:

luarocks install


pg = require('tarantool_psql')
link = pg.connect{host = '', port = 5432, user = 'user', pass = 'pass', db = 'db', sslmode = 'required', connections = 1}
data = link:query("SELECT 1 as ONE, '2' as TWOSTRING") 

API Documentation

Connect to a database.
Returns link (connections pool).


  • host - a hostname to connect
  • port - a port numner to connect
  • user - username
  • password - a password
  • dbname - a database name
  • sslmode - a ssl mode used in this connection (see Table 31-1. SSL Mode Descriptions) (default = ‘disable’)
  • connections - connection pool size (0 means do not create connection pool, just establish single connection) (default = ‘0’)


  • link, database connections pool,

Executes a statement with given arguments in printf-like style.
Arguments can be: numeric, string or table types. They will be escaped and formatted automatically.


  • {result1}, {result2}, ... on success
  • false, error description, on error


### `link:query("SELECT %d AS a, %s AS b", 42, 'string_value')
- - - a: 42
      b: "string_value"

Closes database link.

Returns: nil

See Also