[Sputnik-list] LuaSQL Versium Plugin

Jim Whitehead II jnwhiteh at gmail.com
Tue Mar 4 03:38:24 GMT+2 2008


On Tue, Mar 4, 2008 at 4:20 AM, Yuri Takhteyev <qaramazov at gmail.com> wrote:
> Nice!  I got it running with Xavante myself and wrote up step-by-step
>  instructions at http://sputnik.freewisdom.org/en/SQL_Storage in case
>  someone else wants to try.
>
>  The somewhat unfortunate thing is that there is no rock for luasql, so
>  you have to use the Kepler installer and set --with-optional=luasql.
>  I'll beg for a rock on the Kepler list.

There is a rock for LuaSQL, it's just on the CVS repository:
http://luarocks.luaforge.net/rocks-cvs/

>  Will this is licensed under MIT/X?

Whatever is convenient for inclusion into sputnik/versium although
consider it public domain at this point.

>  A comment on the code:
>
>     function LuaSQLVersiumStorage:get_node_history(id, prefix)
>         ...
>         -- TODO: This doesn't return the raw representation at the moment
>         return history
>     end
>
>  I take responsibility for failing to provide a clear spec and sending
>  you and Sérgio to reverse engineer simple.lua... get_node_history()
>  does not _need_ to return the raw representation (which would be
>  implementation specific anyway and of no use to versium).
>  get_node_history() in simple.lua returns raw_representation as a
>  second parameter only so that it this function could be re-used when
>  saving the node.  In retrospect, that probably wasn't a good idea,
>  from the readability point of view.  I'll change it to two functions:
>  get_node_history() which would return just the history and local
>  _get_node_history_with_raw_representation().

Ah good, I was afraid I was missing out on something, but it worked :P

>  >  In theory this _should_ work with any of the LuaSQL drivers as long as
>  >  you specify the right driver and connection parameters.  Simply
>  >  install the correct rock from the CVS repository, and go go go!  I've
>  >  noticed quite a speed increase using even the unoptimized MySQL.
>
>  Which CVS repository?  They have a LuaSQL rock in CVS but not in the
>  luarocks repository?

See http://luarocks.luaforge.net/rocks-cvs/.

- Jim



More information about the Sputnik-list mailing list