This commit is contained in:
2020-11-15 16:49:42 -05:00
parent a784f12aed
commit f690fb147b
12 changed files with 431 additions and 168 deletions

View File

@@ -0,0 +1,22 @@
local globaldb=class('globaldb')
function globaldb.get(db, key)
local result = db[key]
if type(result) == 'table' then
return result
else
result = {}
db[key] = result
end
return result
end
function globaldb.accessor(db)
return function(key)
return globaldb.get(db, key)
end
end
function globaldb.create()
return {}
end