An open API service indexing awesome lists of open source software.

https://github.com/handrake/sqlua

Pure LuaJIT+FFI SQLite3 binding
https://github.com/handrake/sqlua

lua sqlite3

Last synced: about 1 year ago
JSON representation

Pure LuaJIT+FFI SQLite3 binding

Awesome Lists containing this project

README

          

# Sqlua

[![GitHub Stars](https://img.shields.io/github/stars/handrake/sqlua?style=social)](https://github.com/handrake/sqlua/stargazers)
[![GitHub Watchers](https://img.shields.io/github/watchers/handrake/sqlua?style=social)](https://github.com/handrake/sqlua/watchers)

Pure LuaJIT+FFI SQLite3 binding with:

- Named + positional binding
- Statement caching
- Zero C code

## Example

```lua
local sqlua = require("sqlua")
local db = sqlua.connect(":memory:")

db:execute("CREATE TABLE users (id INT, name TEXT)")
db:execute("INSERT INTO users VALUES (?, ?)", {1, "Alice"})

for row in db:rows("SELECT * FROM users") do
print(row.id, row.name)
end

db:close()