LuaSQL is a simple interface from Lua to a DBMS.
C Lua Java Other
Latest commit 6316be8 Sep 16, 2016 @mpeterv mpeterv luasql.postres: fix buffer allocation for conn:escape result
`luaL_buffinitsize(L, B, sz)` is equivalent to
`luaL_buffinit(L, B); luaL_prepbuffsize(B, sz)`, not
`luaL_buffinit(L, B); luaL_prepbuffer(B)`.
The latter uses `LUAL_BUFFERSIZE` (8192 by default)
as buffer size, which may be not enough, causing
a segfault.

Additionally, detection of availability of
`luaL_buffinitsize` and `luaL_pushresultsize` was broken:
these functions are not macros, so `#if defined(...)` does not
work. Always use fallback implementations instead; they are
short and the functions are only used once.

Ref #55.

README

LuaSQL
http://keplerproject.github.io/luasql

LuaSQL is a simple interface from Lua to a DBMS. It enables a Lua program to:

    * Connect to ODBC, ADO, Oracle, MySQL, SQLite, Firebird and PostgreSQL databases; 
    * Execute arbitrary SQL statements;
    * Retrieve results in a row-by-row cursor fashion.

LuaSQL is free software and uses the same license as Lua 5.1. 


Source code for LuaSQL can be downloaded from its GitHub repository.