Skip to content

Synchronize non-primitive custom structures into memory-mapped files.

License

Notifications You must be signed in to change notification settings

Cyvadra/MmapDB.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MmapDB.jl

Build Status

Usage

using MmapDB

# set data folder for storage
MmapDB.Init(homedir()*"/Desktop/test")

mutable struct Something
	# all subtypes should be primitive
	region_id::UInt8
	longitude::Float64
	latitude::Float64
	timestamp::Int64
	end
t = MmapDB.GenerateCode(Something)
# auto generated TableSomething in Main module
# you can also use custom var name for convenience

# create a table for maximum 10000 rows
TableSomething.Create!(10000) # mmap generated
# TableSomething.		# use tab to show all generated methods
# TableSomething.SetRow(id, any_struct_compatible)
# TableSomething.SetFieldTimestamp(id, ...)
# TableSomething.GetRow(id)::Main.Something
# TableSomething.GetFieldTimestamp(id/range/vector)::Int64/Vector{Int64}

# next time directly open db file
TableSomething.Open(false) # using true for persistance, false for read only

Todos

  1. Support field index.

  2. Support string field.

  3. Split date files into multiple.

  4. Time sequence optimization. (move to private repo)

  5. Consider build a private layer of memory cache, then disable real-time synchronization on disk. (deprecated)

About

Synchronize non-primitive custom structures into memory-mapped files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages