Sunday, October 11, 2009

iPhone dev Stupidity 56: Sqlite3 Lua binding

Lua scripting for Sqlite3

1. using sqlite3 binder: lsqlite3
    fix the make file to link with lua.a - (the default is liblua51 which might be for win/linux)
    make it will produce a lsqlite3.bundle which is not in the lua path

2. fix luaconf.h to add *.bundle in search path(from lua-users.org)

    #define LUA_CPATH_DEFAULT \
     "./?.bundle;"  LUA_CDIR"?.bundle;" LUA_CDIR"loadall.bundle;" \
     "./?.so;"  LUA_CDIR"?.so;" LUA_CDIR"loadall.so"

    Then:
    > make macosx
    > make install

Now you can require 'lsqlite3' to script more.

The test suite of lsqlite3 can pass while there's many non-aligned pointer release error (which doesn't matter very much).



No comments: