Skip to content

lvzixun/lazy_table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazy_table

A libary for loading table lazyly from binary data. the real value will only be loaded when used. you can use it as a simple database libary. ;)

encode

serialize table object to binary data file.

local encode = require "lazy_table.encode"
local source = {
    foo = 11,
    bar = 22,
    int = {
        33, 44, "test_string",
    },
    optional = true,
    [1] = {},
}

local data = encode(source)
write_file("source.lzt", data)

decode

create lazy_table object from binary data file.

local decode = require "lazy_table.decode"
local source_obj = decode("source.lzt")
print(source_obj.int[3])
-- output
-- test_string

example

read t.lua file for more detail.

About

lazy access table from stream

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages