lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I would like to use sqlite3 with lua. Luckily, there exist a wrapper
library. As neither luadist nor luarocks seem to work out of the box
with msys(or if they do, both their luasql packages are broken), I've
downloaded the windows binary release from
http://lua.sqlite.org/index.cgi/index. I unpacked luasql/sqlite3.dll
into the directory with my lua files and called the lua interpreter to
try out the functionality outlined in the documentation(e.g.
"sqlite3.open(filename)")

> require "stdlib"
> require "luasql.sqlite3"
> pprint(luasql)
{sqlite3 = 'function: 0062B810', _VERSION = 'LuaSQL 2.1.0', _DESCRIPTION = 'LuaS
QL is a simple interface from Lua to a DBMS', _COPYRIGHT = 'Copyright (C) 2003-2
007 Kepler Project}

Okay, so the only thing I can do at all is call luasql.sqlite3()?
Let's try that.

> result = luasql.sqlite3()
> =result
SQLite3 environment (0062D290)
> =type(result)
userdata
> result.open("foo")
Error: stdin:1: attempt to call field 'open' (a nil value)
[1] open
[2] Unknown
[3] Unknown

Alright, yeah, I'm stuck. Does this mean the official binary release
is somehow broken, or is there simply something that isn't documented?