An Embedded NoSQL, Transactional Database Engine
See the codeUnQLite is a self-contained, serverless, transactional database engine for C and C++ applications.
It runs in-process, stores data in a single portable file, and ships as a small embed-friendly codebase with no external runtime dependency. UnQLite exposes two layers:
Official website: https://unqlite.symisc.net/
Current public release: 1.2.1
UNQLITE_ENABLE_THREADSIf you want the simplest and most stable embed story, use the amalgamation files at the repository root:
unqlite.cunqlite.hThat is the intended drop-in path for production embedding.
The src/ directory contains the split source tree used to build and maintain the amalgamation.
unqlite.c: amalgamated implementationunqlite.h: public header for the amalgamation buildsrc/: split source tree and internal headerssamples/: small example programsCHANGELOG.md: release notesLICENSE: 2-Clause BSD licenseThe fastest way to embed UnQLite is to compile your application together with unqlite.c.
cc -O2 -std=c99 -I. your_app.c unqlite.c -o your_app
Compile the bundled key/value intro sample:
cc -O2 -std=c99 -I. samples/1.c unqlite.c -o unqlite_kv_intro
cl /nologo /TC /I. your_app.c unqlite.c
Compile the bundled key/value intro sample:
cl /nologo /TC /I. samples\1.c unqlite.c /link /OUT:unqlite_kv_intro.exe
If your application needs UnQLite compiled with thread support, define UNQLITE_ENABLE_THREADS when building:
cc -O2 -std=c99 -DUNQLITE_ENABLE_THREADS -I. your_app.c unqlite.c -o your_app
cl /nologo /TC /DUNQLITE_ENABLE_THREADS /I. your_app.c unqlite.c
#include "unqlite.h"
#include <stdio.h>
static int print_value(const void *data, unsigned int len, void *user_data) {
(void)user_data;
fwrite(data, 1, len, stdout);
return UNQLITE_OK;
}
int main(void) {
unqlite *db = 0;
if (unqlite_open(&db, ":mem:", UNQLITE_OPEN_CREATE) != UNQLITE_OK) {
return 1;
}
if (unqlite_kv_store(db, "hello", -1, "world", 5) != UNQLITE_OK) {
unqlite_close(db);
return 1;
}
if (unqlite_kv_fetch_callback(db, "hello", -1, print_value, 0) != UNQLITE_OK) {
unqlite_close(db);
return 1;
}
putchar('\n');
return unqlite_close(db) == UNQLITE_OK ? 0 : 1;
}
If you only need embedded key/value storage, you can stay entirely within the unqlite_kv_* API family and ignore the document-store layer.
The samples/ directory contains small, focused examples for common integration paths.
Useful starting points:
samples/1.c: key/value introductionsamples/2.c through samples/6.c: broader API usagesamples/unqlite_huge.c: large-value handlingsamples/unqlite_tar.c: archive-oriented examplesamples/unqlite_mp3.c: metadata-oriented exampleThe official documentation lives on the new site:
samples/1.c.UnQLite is distributed under the 2-Clause BSD license.
363 followers · starred May 2025
366 followers · starred Nov 2024
184 followers · starred Mar 2023
1,452 followers · starred Dec 2022
An Embedded NoSQL, Transactional Database Engine
See the codeUnQLite is a self-contained, serverless, transactional database engine for C and C++ applications.
It runs in-process, stores data in a single portable file, and ships as a small embed-friendly codebase with no external runtime dependency. UnQLite exposes two layers:
Official website: https://unqlite.symisc.net/
Current public release: 1.2.1
UNQLITE_ENABLE_THREADSIf you want the simplest and most stable embed story, use the amalgamation files at the repository root:
unqlite.cunqlite.hThat is the intended drop-in path for production embedding.
The src/ directory contains the split source tree used to build and maintain the amalgamation.
unqlite.c: amalgamated implementationunqlite.h: public header for the amalgamation buildsrc/: split source tree and internal headerssamples/: small example programsCHANGELOG.md: release notesLICENSE: 2-Clause BSD licenseThe fastest way to embed UnQLite is to compile your application together with unqlite.c.
cc -O2 -std=c99 -I. your_app.c unqlite.c -o your_app
Compile the bundled key/value intro sample:
cc -O2 -std=c99 -I. samples/1.c unqlite.c -o unqlite_kv_intro
cl /nologo /TC /I. your_app.c unqlite.c
Compile the bundled key/value intro sample:
cl /nologo /TC /I. samples\1.c unqlite.c /link /OUT:unqlite_kv_intro.exe
If your application needs UnQLite compiled with thread support, define UNQLITE_ENABLE_THREADS when building:
cc -O2 -std=c99 -DUNQLITE_ENABLE_THREADS -I. your_app.c unqlite.c -o your_app
cl /nologo /TC /DUNQLITE_ENABLE_THREADS /I. your_app.c unqlite.c
#include "unqlite.h"
#include <stdio.h>
static int print_value(const void *data, unsigned int len, void *user_data) {
(void)user_data;
fwrite(data, 1, len, stdout);
return UNQLITE_OK;
}
int main(void) {
unqlite *db = 0;
if (unqlite_open(&db, ":mem:", UNQLITE_OPEN_CREATE) != UNQLITE_OK) {
return 1;
}
if (unqlite_kv_store(db, "hello", -1, "world", 5) != UNQLITE_OK) {
unqlite_close(db);
return 1;
}
if (unqlite_kv_fetch_callback(db, "hello", -1, print_value, 0) != UNQLITE_OK) {
unqlite_close(db);
return 1;
}
putchar('\n');
return unqlite_close(db) == UNQLITE_OK ? 0 : 1;
}
If you only need embedded key/value storage, you can stay entirely within the unqlite_kv_* API family and ignore the document-store layer.
The samples/ directory contains small, focused examples for common integration paths.
Useful starting points:
samples/1.c: key/value introductionsamples/2.c through samples/6.c: broader API usagesamples/unqlite_huge.c: large-value handlingsamples/unqlite_tar.c: archive-oriented examplesamples/unqlite_mp3.c: metadata-oriented exampleThe official documentation lives on the new site:
samples/1.c.UnQLite is distributed under the 2-Clause BSD license.
363 followers · starred May 2025
366 followers · starred Nov 2024
184 followers · starred Mar 2023
1,452 followers · starred Dec 2022