[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua and Postgres
- From: Tomas Guisasola Gorham <tomas@...>
- Date: Fri, 14 Jan 2011 10:56:58 -0200 (BRST)
Hi Steve
1) Is LuaSQL the best way to interface between Lua and Postgres?
As Marc already mentioned, LuaSQL aims portability, thus it could lack some PostgreSQL specifics.
2) Is it necessary to go through LuaRocks? Is there a better way?
It is not necessary. You can use the Makefile.
3) What is the procedure to install the Lua/Postgres interface?
I think it is described in the distribution file, but generally
speaking, you to compile ls_postgres.c and luasql.c (with access to
lua.h and libpq-fe.h), then produce a postgres.so file, which will
contain the function luaopen_luasql_postgres.
After that, you have to install it in your LUA_CPATH, in a directory named luasql to be able to load the driver with require"luasql.postgres", which will give you a function to create the environment. In a Linux box, the file could be installed at /usr/local/lib/lua/5.1/luasql/postgres.so.
Hope this helps!
Regards,
Tomás