95 I started work on the query builder.
helper.db:select("*")
helper.db:from("users")
local rows =helper.db:get()
local data = helper.db:result(rows)
local readableData={}
for key,value in pairs (data) do
table.insert(readableData,table.concat(value," "))
end
return readableData
2 things that I want to add but I am not sure if one is possible.
The first being function chaining, however I expect this to not work very well. Maybe if I make it so you give the next function? Or you are able to make a table for the order and arguments to the functions you want to execute?
The other being is that you can supply the result function with another function that will be executed in the foreach loop that gathers the data instead of table.insert() or something among those lines.
Because the result function is pretty much a for loop so currently there are 2 loops being executed when 1 could do.
But I think that making the where, join group, remove, insert and stuff like that is more important as well as making sure everything is automatically escaped but need to figure out how prepared statements exactly work with luaDBI (Another thing I need to do later on is add support for luaSQL. LuaDBI is better in my eyes due to prepared statements but hasn't had any development since 2 years or so now and is thus getting outdated
)