lua-users home
lua-l archive

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


On Sun, Mar 13, 2011 at 9:42 AM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Sun, Mar 13, 2011 at 1:23 AM, Luciano de Souza <luchyanus@gmail.com> wrote:
>> Is the conclusion that I can't use foreign keys with Luasqlite.sqlite3()?
>
> you could recompile LuaSQLite with a newer SQLite library.
>

I have recompiled LuaSQ 2.1.1 (as downloaded from
<http://www.keplerproject.org>) using MingW and Sqlite 3.7.5. The
resulting dll seems to work fine for the limited number of SQL
statements that I have tried but NOT so hot with PRAGMAs. ;(

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require "luasql.sqlite3"
> env = luasql.sqlite3()
> con = env:connect("")
> cur = con:execute("select sqlite_version()")
> print(cur:fetch())
3.7.5
> cur = con:execute("pragma foreign_keys")
> print(cur)
SQLite3 cursor (0037C118)
> print(cur:fetch())
nil     LuaSQL: out of memory
> cur = con:execute("pragma foreign_keys=1")
> print(cur)
0
> cur = con:execute("pragma foreign_keys=0")
> print(cur)
0

This MAY be an artifact of my ignorance in building LuaSQL ;) but I am
inclined to believe that it is a limitation of LuaSQL Version 2.1.1.
See:

<http://www.mail-archive.com/kepler-project@lists.luaforge.net/msg00752.html>

--