Page 1 of 1
Can i use SQLite in a mod ?

Posted:
Tue Dec 18, 2012 14:54
by aldobr
Can i use SQLite in a mod ?
It would simplify a lot my mod (Mint & Automatic Selling Machine),
because i need to calculate the stack exchange prices of all items, so i need a log of all transactions.

Posted:
Tue Dec 18, 2012 17:06
by kaeza
You can create your own format annd save/load using Lua's I/O routines.
If you really intend to use SQLite, you may be able to load a native lib wrapper, but that requires a bit more work, and users must compile the library for their particular system. This is how my IRC mod (look at my sig) works.

Posted:
Thu Dec 20, 2012 22:33
by aldobr
I believe lua:io wont cut.
Thats because everytime a player uses a machine, a log entry should be added to a database.
Then it should (once a day) sum all sells/buts per item kind.
then write the result to another table.
in order to build a monthly graph (png) of the medium sell/buy price of items.
I believe thats too heavy for lua. You can do that efficiently using sqlite3. Thats why i want to use lua:sqlite3...