Lua-Sqlite3 - Sqlite3 Binding for Lua

About

Lua-Sqlite3 is a binding of Sqlite3 for Lua.

Lua-Sqlite3 is unique in contrast to other database bindings that it consists of two layers. The first layer translates the SQLite 3 implementation's C API to Lua. The first layer is called the backend. The second layers are frontend layers, written in Lua. These layers provide a nice and smart view of the database

Currently, Lua-Sqlite3 implements two frontends:

  1. A specialiced frontend which provides all sqlite3 capabilities.
  2. A LuaSQL compatible frontend as used on the Kepler Project.

News

11. May 2006: Lua-Sqlite3 Version 0.4.1 released.

Small fix to compile with MSVC6.

9. May 2006: Lua-Sqlite3 Version 0.4 released.

15. June 2005: Lua-Sqlite3 Version 0.3 released.

Lua-Sqlite3 works pretty solid and the user base is growing, so the first bug was reported. Also new features requested were implemented. Details:

7. October 2004: Lua-Sqlite3 Version 0.2 released.

Lua-Sqlite3 should now compile with older compilers and now requires the latest sqlite library, version 3.0.7 to work correctly.

14. September 2004: Lua-Sqlite3 Version 0.1 (alpha) released.

This is the first public release of Lua-Sqlite3.

Example

require "sqlite3"

db = sqlite3.open("example-db.sqlite3")

db:exec[[ CREATE TABLE test (id, content) ]]

stmt = db:prepare[[ INSERT INTO test VALUES (:key, :value) ]]

stmt:bind{  key = 1,  value = "Hello World"    }:exec()
stmt:bind{  key = 2,  value = "Hello Lua"      }:exec()
stmt:bind{  key = 3,  value = "Hello Sqlite3"  }:exec()

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

Documentation

Full documentation: documentation.html

Download

Lua-Sqlite3 is available as a gziped tar archive and as a zip-file. Examples and documentation are included.
The archives are signed using GPG with my key

Latest release:

Older releases:

Contact

Please feel free to send questions, suggestions, feature requests and bug reports to Michael Roth <mroth@nessie.de>.


Back to my little Homepage
Last update: 2006-05-11
Copyright (c) 2004, 2005, 2006 Michael Roth