SUMStudio / grocksdb

RocksDB wrapper for Go. Support 6.25.x, 6.24.x, 6.23.x, 6.22.x, 6.20.x, 6.19.x, etc. Latest 6.25.3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grocksdb, RocksDB wrapper for Go

Go Report Card Coverage Status godoc

This is a Fork from tecbot/gorocksdb. I respect the author work and community contribution. The LICENSE still remains as upstream.

Why I made a patched clone instead of PR:

  • Supports almost C API (unlike upstream). Catching up with latest version of Rocksdb as promise.
  • This fork contains no defer in codebase (my side project requires as less overhead as possible). This introduces loose convention of how/when to free c-mem, thus break the rule of tecbot/gorocksdb.

Install

Prerequisite

  • librocksdb
  • libsnappy
  • libz
  • liblz4
  • libzstd

Please follow this guide: https://github.com/facebook/rocksdb/blob/master/INSTALL.md to build above libs.

Build

After that, you can install and build grocksdb using the following commands:

go get -u github.com/linxGnu/grocksdb

CGO_CFLAGS="-I/path/to/rocksdb/include" \
CGO_LDFLAGS="-L/path/to/rocksdb -lrocksdb -lstdc++ -lm -lz -lsnappy -llz4 -lzstd" \
  go build

Or just:

go build // if prerequisites are in linker paths

Usage

See also: doc

API Support

Almost C API, excepts:

  • putv/mergev/deletev/delete_rangev
  • compaction_filter/compaction_filter_factory/compaction_filter_context
  • transactiondb_property_value/transactiondb_property_int
  • optimistictransactiondb_property_value/optimistictransactiondb_property_int

About

RocksDB wrapper for Go. Support 6.25.x, 6.24.x, 6.23.x, 6.22.x, 6.20.x, 6.19.x, etc. Latest 6.25.3

License:MIT License


Languages

Language:Go 75.7%Language:C 23.7%Language:Shell 0.5%Language:Makefile 0.1%