lua-users home
lua-l archive

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


Hey,

orbit buffers changes to the table (so to say) until the update() or save() method is called, so I think there is no metatable involved. This is done because on wants to limit the number of queries. Your method is more intuitive in the sense that the lua table is directly linked to the database and all data is up to date in both places at any time. Maybe you can still get something out of their methods for building queries.
However, yours is a nice idea. Looking forward to some code.

Best,
Ben


On Fri, Jan 31, 2014 at 4:07 PM, Milind Gupta <milind.gupta@gmail.com> wrote:
Thanks for letting me know about Orbit model. Its a bit hard to follow since there are  no comments. Also could not fing any __newindex metamethod so I wonder how to they manage writing to tables directly going to database.
I am doing it so that the user may just as well plug in this model to their existing program without any change to the table manipulation code. The table writes and reads are all handled by metamethods and I plan to accommodate these modified tables by temporarily replacing global ipars and pairs functions.

Luiz,
    Was that library in open source?

Thanks.


On Fri, Jan 31, 2014 at 7:01 AM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>       I have started work on a small module to map lua tables directly to
> sqlite database using luasql. The aim is that if you are using lua tables
> to store all your data then that is all you do. You use them like normal
> lua tables and in the end just do a save command and the changes get saved
> to a database.

I did something similar in my very first Lua library, a gdbm binding,
but all changes in the Lua table were committed to the gdbm file.