Ask coding questions

← Back to all posts
[LUA] Is there a way to use lua for databases
Altarias (46)

This is a question that has been bothering me for quite a bit, I already heard about LuaSQL but is there a simpler way to include it in a project? I'm talking about databases like MySQL, SQLite & SQLite-3 etc.

TIA,
Altar

Answered by a5rocks (732) [earned 5 cycles]
View Answer
Commentshotnewtop
a5rocks (732)

https://github.com/pllua/pllua One of the first few results for Postgres integration with Lua.

But what exactly are you looking for?

Sorry that I didn't really notice what you were looking for on first glance...

Altarias (46)

@a5rocks I am looking for a way to store save data of people that play Luagame somewhere, so that I do not have to rely on my buggy mess of a "local save file loader"
Edit: "LOCAL" meaning that the safe file is loaded from the repl's file system.

a5rocks (732)

@Altarias to be honest, most games store their data in some sort of "save file folder", as dbs just aren't fit for the task (too heavy probably, and need to be kept running).

Altarias (46)

@a5rocks You have shown me that a theoretical usage of databases is possible. You have answered my question, even if it was not really what I was looking for. I appreciate that you took your time.

Now to go back to fix the local save loader.

a5rocks (732)

@Altarias yw :D

By the way, in the brief research I did, are you using something like eris? That seems like something you might want to use.

Altarias (46)

@a5rocks I will look into it. Thanks.
EDIT: I looked it up and found out that it is only for LUA 5.2, on repl I am however limited to LUA 5.1.5, thus I need to use pluto.