Skip to content

kklots/matlab-lmdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matlab LMDB

Matlab LMDB wrapper for UNIX environment.

See also matlab-leveldb.

Build

addpath /path/to/matlab-lmdb;
lmdb.make();
lmdb.make('test');

Edit Makefile to customize the build process.

Example

% Open and close.
database = lmdb.DB('./db', 'MAPSIZE', 1024^3);
clear database;
readonly_database = lmdb.DB('./db', 'RDONLY', true);
clear readonly_database;

% Read and write.
database.put('key1', 'value1');
database.put('key2', 'value2');
value1 = database.get('key1');
database.remove('key1');

% Iterator.
database.each(@(key, value) disp([key, ': ', value]));
count = database.reduce(@(key, value, count) count + 1, 0);

% Transaction.
transaction = database.begin();
try
  transaction.put('key1', 'value1');
  transaction.put('key2', 'value2');
  transaction.commit();
catch exception
  transaction.abort();
end

TODO

  • Finer transaction API.

About

Matlab LMDB wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 80.3%
  • C++ 17.4%
  • MATLAB 1.6%
  • Makefile 0.7%