Buffer too small for table
/defsave/defsave.lua:191: buffer (524280 bytes) too small for table
Maybe there could be an option for using io.* as Britzl mention on the forum
You could use json encoding for the table and normal io.* functions to load and save.
Reproduced with pushing random data
local key = 1
local function callback(self, _, response)
defsave.set("lorem", key, response.response)
key = key + 1
end
function init(self)
defsave.load("lorem")
for i=1, 80 do
http.request("https://baconipsum.com/api/?type=all-meat¶s=20&start-with-lorem=1", "GET", callback)
end
end
JSON (or other data types) is possible, the problem with any of that some types of userdata doesn't translate as far as I know.
Does sys.save allow for other userdata?
It has to be a table but if the userdata is a string it could be saved inside of a small table.
Internally, this function uses a workspace buffer sized output file sized 512kb. This size reflects the output file size which must not exceed this limit. Additionally, the total number of rows that any one table may contain is limited to 65536 (i.e. a 16 bit range). When tables are used to represent arrays, the values of keys are permitted to fall within a 32 bit range, supporting sparse arrays, however the limit on the total number of rows remains in effect.