MVault 1.0.0
Simple c++ database
Loading...
Searching...
No Matches
MVault

A simple in-memory table database focused on maximum performance and reliability. Provided as a dependless library with a simple and beautiful API.

Key features

  1. The STL strings are used as keys.
  2. Type safety.
  3. A custom data type can be used inside the database.
  4. Supports complex queries and subqueries.
  5. Full multithreaded code support.
  6. Using efficient data structures such as hash tables and binary trees to store data.
  7. CSV support.
  8. Exceptless code.

Quick start

First of all, download the debug library binaries. After that, write a simple program.

++
#include <MVault.h>
int main()
{
vlt.AddKey("A", 0);
vlt.CreateRecord({});
vlt.Print();
}
A class for storing data with the ability to quickly search for a variety of different keys of any ty...
Definition Vault.h:35
void Print(const bool &isPrintId=false, const std::size_t &amountOfRecords=-1, const std::string &primaryKey="", const bool &isReverse=false, const std::list< std::string > &keys={}) const noexcept
A method for displaying the contents of a Vault as a table on the screen.
Definition Vault.cpp:797
VaultOperationResult AddKey(const std::string &key, const T &defaultKeyValue, const bool &isUniqueKey, const bool &isUniqueKeyWithoutLambda, const std::function< T(const std::size_t &counter, const VaultRecordRef &ref)> &uniqueKeyFunction) noexcept
Template method to add new key with default value to Vault.
Definition Vault.hpp:325
VaultOperationResult CreateRecord(const std::vector< std::pair< std::string, VaultParamInput > > &params) noexcept
Method to create new VaultRecord.
Definition Vault.cpp:428

Now compile the example using the command:

g++ main.cpp -IMVaultD/include -LMVaultD/lib -lMVault

Call a.out and get the output:

+---+
| A |
+---+
| 0 |
+---+
(1 records)

Guides

See the instructions for installing the library here.
Check the examples of using the library:

  1. Basic example
  2. Keys example
  3. Requests example

FAQ

  • How do I display the contents of my class?
    To do this, define the ToString function for your type. More information is available here.
  • How to use custom class inside vault?
    To do this, you need to define a hashing function from std for your data type. More information is available here.