TidesDB v0.4.0b #204
guycipher
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TidesDB v0.4.0b pre release.
Features
Building
Using cmake to build the shared library.
cmake -S . -B build cmake --build build cmake --install build
Requirements
You need cmake and a C compiler that supports C.
You also require the
snappy
,lz4
, andzstd
libraries.Linux
MacOS
Windows
Windows using vcpkg
Dependencies
Include
Usage
Each database method returns a
tidesdb_err_t*
which returns an error code and message. If no error, TidesDB returnsNULL
.Example of error structure
Opening a database
To open a database you pass the path to the database directory and a pointer to the database.
Creating a column family
In order to store data in TidesDB you need a column family. This is by design.
You pass
TDB_MEMTABLE_SKIP_LIST
) pass 0 if usingTDB_MEMTABLE_HASH_TABLE
TDB_MEMTABLE_SKIP_LIST
) pass 0.0 if usingTDB_MEMTABLE_HASH_TABLE
TDB_NO_COMPRESSION
,TDB_COMPRESS_SNAPPY
,TDB_COMPRESS_LZ4
,TDB_COMPRESS_ZSTD
]TDB_MEMTABLE_SKIP_LIST
,TDB_MEMTABLE_HASH_TABLE
]Using Snappy compression and bloom filters for column family sstables
Dropping a column family
Listing column families
Putting a key-value pair
You pass
Putting a key-value pair with TTL
Getting a key-value pair
You pass
Deleting a key-value pair
You pass
Transactions
You can perform a series of operations atomically. This will block other threads from reading or writing to the column family until the transaction is committed or rolled back.
You begin a transaction by calling
tidesdb_txn_begin
.You pass
Now we can add operations to the transaction.
Cursors
You can iterate over key-value pairs in a column family.
Compaction
You can manually compact sstables. This method pairs and merges column family sstables.
Say you have 100, after compaction you will have 50; Always half the amount you had prior. You can set the number of threads to use for compaction.
What's Changed
New Contributors
Full Changelog: v0.3.0b...v0.4.0b
This discussion was created from the release v0.4.0b.
Beta Was this translation helpful? Give feedback.
All reactions