LMDB Abstraction Layer. A library to ease interactions with LMDB
Find a file
blue 3701fb92a1
All checks were successful
Main LMDBAL workflow / Test LMDBAL with qt5 (push) Successful in 1m13s
Main LMDBAL workflow / Test LMDBAL with qt6 (push) Successful in 1m33s
Main LMDBAL workflow / Builds documentation (push) Successful in 39s
Main LMDBAL workflow / Deploys documentation (push) Successful in 7s
CI 5
2025-05-02 22:08:08 +03:00
.forgejo/workflows CI 5 2025-05-02 22:08:08 +03:00
cmake Some more build fixes 2024-12-13 20:27:47 +02:00
doc Fix typos, fix some warnings, added more compile options, moved to forgejo CI 2025-05-02 18:19:06 +03:00
packaging/Archlinux pragma once and minor change in transactions 2024-12-17 20:03:48 +02:00
src Fix typos, fix some warnings, added more compile options, moved to forgejo CI 2025-05-02 18:19:06 +03:00
test Cursors refactoring part one 2024-12-25 19:19:32 +02:00
CHANGELOG.md Cursors get closed after transaction that open them 2024-12-24 14:59:58 +02:00
CMakeLists.txt Fix typos, fix some warnings, added more compile options, moved to forgejo CI 2025-05-02 18:19:06 +03:00
LICENSE.md Use text from fsf.org 2024-10-05 12:15:03 +00:00
README.md Fix typos, fix some warnings, added more compile options, moved to forgejo CI 2025-05-02 18:19:06 +03:00

LMDBAL - Lightning Memory Data Base Abstraction Level

AUR license AUR qt5 version AUR qt6 version Liberapay patrons Documentation

Prerequisites

  • a c++ compiler (g++ would do)
  • Qt 5 or 6 or higher (qt5-base or qt6-base would do)
  • lmdb
  • CMake 3.16 or higher
  • Doxygen (optional, for documentation)
  • gtest (optional, for tests)

Using with CMake

As a system library

If you're using LMDBAL as a system library, you probably have no control over its build options. The easiest way to include the project is to add the following

find_package(lmdbal)
if (LMDBAL_FOUND)
    target_include_directories(yourTarget PRIVATE ${LMDBAL_INCLUDE_DIRS})
    target_link_libraries(yourTarget PRIVATE LMDBAL::LMDBAL)
endif()

As an embedded subproject

If you're using LMDBAL as a embedded library, you might want to control its build options, for example, you can run

set(LMDBAL_BUILD_STATIC ON)

... before including the library in your project. This will set the library to be build in a static mode.

Then you want to run something like this

add_subdirectory(pathTo/yourEmbedded/libraries/lmdbal)
add_library(LMDBAL::LMDBAL ALIAS LMDBAL)
...

target_link_libraries(yourTarget PRIVATE LMDBAL::LMDBAL)

The headers are added as PUBLIC so you might not even need to target_link_libraries them

Building

LMDBAL uses CMake as a build system.

Please check the prerequisites and install them before building.

Here is an easy way to build a project

$ git clone https://git.macaw.me/blue/lmdbal
$ cd lmdbal
$ mkdir build
$ cd build
$ cmake .. [ *optional keys* ]
$ cmake --build .
$ cmake --install . --prefix install

This way will create you a lmdbal/build directory with temporary files, and lmdbal/build/install with all the export files for installation to the system.

After cmake .. you can specify keys to alter the building process. In this context building keys are transferred like so

cmake .. -D KEY1=VALUE1 -D KEY2=VALUE2 ...

List of keys

Here is the list of keys you can pass to configuration phase of cmake ..:

  • CMAKE_BUILD_TYPE - Debug just builds showing all warnings, Release builds with no warnings and applies optimizations (default is Debug);
  • LMDBAL_BUILD_STATIC - True builds project as a static library, False builds as dynamic (default is False);
  • LMDBAL_BUILD_TESTS - True build unit tests, False does not (default is False);
  • BUILD_DOC - True build doxygen documentation, False does not (default is False);
  • LMDBAL_BUILD_DOXYGEN_AWESOME - True build doxygen awesome theme if BUILD_DOC is also True (default is False);
  • QT_VERSION_MAJOR - 5 links against Qt5, 6 links against Qt6, there is no default, so, if you didn't specify it, the project will choose automatically;
  • LMDBAL_NAME - LMDBAL builds the main target with this name, also the installation path will be this name lowercase, useful if you want to build LMDBAL-QT6 not to conflict with LMDBAL-QT5;
  • LMDBAL_STRICT - True builds with extra warnings and considers them errors (default is False);
  • LMDBAL_ASAN - True builds with address sanitizer (default is False);
  • LMDBAL_TSAN - True builds with thread sanitizer (default is False);
  • LMDBAL_UBSAN - True builds with undefined behavior sanitizer (default is False);

Running tests

If you built the library with -D LMDBAL_BUILD_TESTS=True, then there will be lmdbal/build/tests/runUnitTests executable file. You can run it as

./runUnitTests

... if you're in the same directory with it

License

This project is available under the GPL-3.0 License or any later version. The file cmake/FindLMDB.cmake is available under the GPL-3.0 License only, - see the LICENSE.md file for details