From a691d5b9d252567a91b43b35bf4545d1d33b0cfe Mon Sep 17 00:00:00 2001 From: web3-developer <51288821+web3-developer@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:00:10 +0800 Subject: [PATCH] Format using nph (#54) * Format entire project using nph. * Add nph lint to CI. --- .github/workflows/ci.yml | 20 + config.nims | 6 +- examples/simple_example.nim | 32 +- rocksdb.nim | 19 +- rocksdb.nimble | 27 +- rocksdb/backup.nim | 44 +- rocksdb/columnfamily.nim | 39 +- rocksdb/columnfamily/cfdescriptor.nim | 15 +- rocksdb/columnfamily/cfhandle.nim | 3 +- rocksdb/columnfamily/cfopts.nim | 19 +- rocksdb/internal/cftable.nim | 18 +- rocksdb/internal/utils.nim | 4 +- rocksdb/lib/rocksdb_gen.nim | 7580 +++++++++++++++------- rocksdb/options/backupopts.nim | 4 +- rocksdb/options/cache.nim | 3 +- rocksdb/options/dbopts.nim | 5 +- rocksdb/options/readopts.nim | 3 +- rocksdb/options/tableopts.nim | 17 +- rocksdb/options/writeopts.nim | 3 +- rocksdb/rocksdb.nim | 230 +- rocksdb/rocksiterator.nim | 21 +- rocksdb/rocksresult.nim | 6 +- rocksdb/sstfilewriter.nim | 46 +- rocksdb/transactiondb.nim | 71 +- rocksdb/transactions/transaction.nim | 83 +- rocksdb/transactions/txdbopts.nim | 3 +- rocksdb/transactions/txopts.nim | 3 +- rocksdb/writebatch.nim | 42 +- tests/columnfamily/test_cfdescriptor.nim | 7 +- tests/columnfamily/test_cfhandle.nim | 13 +- tests/columnfamily/test_cfopts.nim | 6 +- tests/internal/test_cftable.nim | 18 +- tests/lib/test_librocksdb.nim | 56 +- tests/options/test_backupopts.nim | 7 +- tests/options/test_dbopts.nim | 7 +- tests/options/test_readopts.nim | 7 +- tests/options/test_writeopts.nim | 7 +- tests/test_backup.nim | 15 +- tests/test_columnfamily.nim | 21 +- tests/test_helper.nim | 35 +- tests/test_rocksdb.nim | 120 +- tests/test_rocksiterator.nim | 47 +- tests/test_sstfilewriter.nim | 17 +- tests/test_transactiondb.nim | 27 +- tests/test_writebatch.nim | 31 +- tests/transactions/test_txdbopts.nim | 7 +- tests/transactions/test_txopts.nim | 7 +- 47 files changed, 5749 insertions(+), 3072 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5988459..1ada03a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,26 @@ on: workflow_dispatch: jobs: + lint: + name: "nph Lint" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base + + - name: Check nph formatting + # Pin nph to a specific version to avoid sudden style differences. + # Updating nph version should be accompanied with running the new + # version on the project directory. + run: | + VERSION="v0.5.1" + ARCHIVE="nph-linux_x64.tar.gz" + curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} + tar -xzf ${ARCHIVE} + ./nph . + git diff --exit-code build: strategy: fail-fast: false diff --git a/config.nims b/config.nims index 5a1c6a8..098d311 100644 --- a/config.nims +++ b/config.nims @@ -23,5 +23,7 @@ when defined(rocksdb_static_linking): switch("dynlibOverride", "lz4") switch("dynlibOverride", "zstd") ---styleCheck:usages ---styleCheck:error +--styleCheck: + usages +--styleCheck: + error diff --git a/examples/simple_example.nim b/examples/simple_example.nim index 6365287..8b5f9d3 100644 --- a/examples/simple_example.nim +++ b/examples/simple_example.nim @@ -17,10 +17,10 @@ proc main() = # snappy support (for example Fedora 28, certain Ubuntu versions) # rocksdb_options_optimize_level_style_compaction(options, 0); # create the DB if it's not already present - rocksdb_options_set_create_if_missing(options, 1); + rocksdb_options_set_create_if_missing(options, 1) - # open DB - var err: cstring # memory leak: example code does not free error string! + var # open DB + err: cstring # memory leak: example code does not free error string! db = rocksdb_open(options, dbPath, cast[cstringArray](err.addr)) doAssert err.isNil, $err @@ -32,15 +32,28 @@ proc main() = var writeOptions = rocksdb_writeoptions_create() let key = "key" let put_value = "value" - rocksdb_put(db, writeOptions, key.cstring, key.len.csize_t, put_value.cstring, - put_value.len.csize_t, cast[cstringArray](err.addr)) + rocksdb_put( + db, + writeOptions, + key.cstring, + key.len.csize_t, + put_value.cstring, + put_value.len.csize_t, + cast[cstringArray](err.addr), + ) doAssert err.isNil, $err # Get value var readOptions = rocksdb_readoptions_create() var len: csize_t - let raw_value = rocksdb_get(db, readOptions, key.cstring, key.len.csize_t, addr len, - cast[cstringArray](err.addr)) # Important: rocksdb_get is not null-terminated + let raw_value = rocksdb_get( + db, + readOptions, + key.cstring, + key.len.csize_t, + addr len, + cast[cstringArray](err.addr), + ) # Important: rocksdb_get is not null-terminated doAssert err.isNil, $err # Copy it to a regular Nim string (copyMem workaround because raw value is NOT null-terminated) @@ -57,8 +70,9 @@ proc main() = # If something is wrong, you might want to restore data from last backup var restoreOptions = rocksdb_restore_options_create() - rocksdb_backup_engine_restore_db_from_latest_backup(be, dbPath, dbPath, - restoreOptions, cast[cstringArray](err.addr)) + rocksdb_backup_engine_restore_db_from_latest_backup( + be, dbPath, dbPath, restoreOptions, cast[cstringArray](err.addr) + ) doAssert err.isNil, $err rocksdb_restore_options_destroy(restore_options) diff --git a/rocksdb.nim b/rocksdb.nim index c857a1d..25e3330 100644 --- a/rocksdb.nim +++ b/rocksdb.nim @@ -8,19 +8,10 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - ./rocksdb/[backup, - columnfamily, - rocksdb, - rocksiterator, - sstfilewriter, - transactiondb, - writebatch] + ./rocksdb/[ + backup, columnfamily, rocksdb, rocksiterator, sstfilewriter, transactiondb, + writebatch, + ] export - backup, - columnfamily, - rocksdb, - rocksiterator, - sstfilewriter, - transactiondb, - writebatch + backup, columnfamily, rocksdb, rocksiterator, sstfilewriter, transactiondb, writebatch diff --git a/rocksdb.nimble b/rocksdb.nimble index 92ca2bc..4b52ba5 100644 --- a/rocksdb.nimble +++ b/rocksdb.nimble @@ -1,16 +1,21 @@ -packageName = "rocksdb" -version = "0.4.0" -author = "Status Research & Development GmbH" -description = "A wrapper for Facebook's RocksDB, an embeddable, persistent key-value store for fast storage" -license = "Apache License 2.0 or GPLv2" -skipDirs = @["examples", "tests"] -mode = ScriptMode.Verbose +packageName = "rocksdb" +version = "0.4.0" +author = "Status Research & Development GmbH" +description = + "A wrapper for Facebook's RocksDB, an embeddable, persistent key-value store for fast storage" +license = "Apache License 2.0 or GPLv2" +skipDirs = @["examples", "tests"] +mode = ScriptMode.Verbose ### Dependencies -requires "nim >= 1.6", - "results", - "tempfile", - "unittest2" +requires "nim >= 1.6", "results", "tempfile", "unittest2" + +# Format only works with nim version 2 +task format, "Format nim code using nph": + # Using the latest nph commit for now because the latest tagged version + # doesn't work with the latest nim 2 version + exec "nimble install nph@#head" + exec "nph ." task clean, "Remove temporary files": exec "rm -rf build" diff --git a/rocksdb/backup.nim b/rocksdb/backup.nim index 3e563db..b29b20d 100644 --- a/rocksdb/backup.nim +++ b/rocksdb/backup.nim @@ -12,16 +12,9 @@ {.push raises: [].} import - ./lib/librocksdb, - ./internal/utils, - ./options/backupopts, - ./rocksdb, - ./rocksresult + ./lib/librocksdb, ./internal/utils, ./options/backupopts, ./rocksdb, ./rocksresult -export - backupopts, - rocksdb, - rocksresult +export backupopts, rocksdb, rocksresult type BackupEnginePtr* = ptr rocksdb_backup_engine_t @@ -32,23 +25,20 @@ type backupOpts: BackupEngineOptionsRef proc openBackupEngine*( - path: string, - backupOpts = defaultBackupEngineOptions()): RocksDBResult[BackupEngineRef] = + path: string, backupOpts = defaultBackupEngineOptions() +): RocksDBResult[BackupEngineRef] = ## Create a new backup engine. The `path` parameter is the path of the backup ## directory. Note that the same directory should not be used for both backups ## and the database itself. var errors: cstring let backupEnginePtr = rocksdb_backup_engine_open( - backupOpts.cPtr, - path.cstring, - cast[cstringArray](errors.addr)) + backupOpts.cPtr, path.cstring, cast[cstringArray](errors.addr) + ) bailOnErrors(errors) - let engine = BackupEngineRef( - cPtr: backupEnginePtr, - path: path, - backupOpts: backupOpts) + let engine = + BackupEngineRef(cPtr: backupEnginePtr, path: path, backupOpts: backupOpts) ok(engine) proc isClosed*(backupEngine: BackupEngineRef): bool {.inline.} = @@ -56,26 +46,23 @@ proc isClosed*(backupEngine: BackupEngineRef): bool {.inline.} = backupEngine.cPtr.isNil() proc createNewBackup*( - backupEngine: BackupEngineRef, - db: RocksDbRef): RocksDBResult[void] = + backupEngine: BackupEngineRef, db: RocksDbRef +): RocksDBResult[void] = ## Create a new backup of the database. doAssert not backupEngine.isClosed() doAssert not db.isClosed() var errors: cstring rocksdb_backup_engine_create_new_backup( - backupEngine.cPtr, - db.cPtr, - cast[cstringArray](errors.addr)) + backupEngine.cPtr, db.cPtr, cast[cstringArray](errors.addr) + ) bailOnErrors(errors) ok() proc restoreDbFromLatestBackup*( - backupEngine: BackupEngineRef, - dbDir: string, - walDir = dbDir, - keepLogFiles = false): RocksDBResult[void] = + backupEngine: BackupEngineRef, dbDir: string, walDir = dbDir, keepLogFiles = false +): RocksDBResult[void] = ## Restore the database from the latest backup. doAssert not backupEngine.isClosed() @@ -88,7 +75,8 @@ proc restoreDbFromLatestBackup*( dbDir.cstring, walDir.cstring, restoreOptions, - cast[cstringArray](errors.addr)) + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) rocksdb_restore_options_destroy(restoreOptions) diff --git a/rocksdb/columnfamily.nim b/rocksdb/columnfamily.nim index 823eb05..7862684 100644 --- a/rocksdb/columnfamily.nim +++ b/rocksdb/columnfamily.nim @@ -19,8 +19,7 @@ {.push raises: [].} -import - ./rocksdb +import ./rocksdb export rocksdb @@ -34,8 +33,8 @@ type name: string proc withColFamily*( - db: RocksDbReadOnlyRef, - name: string): RocksDBResult[ColFamilyReadOnly] = + db: RocksDbReadOnlyRef, name: string +): RocksDBResult[ColFamilyReadOnly] = ## Creates a new `ColFamilyReadOnly` from the given `RocksDbReadOnlyRef` and ## column family name. @@ -46,8 +45,8 @@ proc withColFamily*( ok(ColFamilyReadOnly(db: db, name: name)) proc withColFamily*( - db: RocksDbReadWriteRef, - name: string): RocksDBResult[ColFamilyReadWrite] = + db: RocksDbReadWriteRef, name: string +): RocksDBResult[ColFamilyReadWrite] = ## Create a new `ColFamilyReadWrite` from the given `RocksDbReadWriteRef` and ## column family name. @@ -66,39 +65,39 @@ proc name*(cf: ColFamilyReadOnly | ColFamilyReadWrite): string {.inline.} = cf.name proc get*( - cf: ColFamilyReadOnly | ColFamilyReadWrite, - key: openArray[byte], - onData: DataProc): RocksDBResult[bool] {.inline.} = + cf: ColFamilyReadOnly | ColFamilyReadWrite, key: openArray[byte], onData: DataProc +): RocksDBResult[bool] {.inline.} = ## Gets the value of the given key from the column family using the `onData` ## callback. cf.db.get(key, onData, cf.name) proc get*( - cf: ColFamilyReadOnly | ColFamilyReadWrite, - key: openArray[byte]): RocksDBResult[seq[byte]] {.inline.} = + cf: ColFamilyReadOnly | ColFamilyReadWrite, key: openArray[byte] +): RocksDBResult[seq[byte]] {.inline.} = ## Gets the value of the given key from the column family. cf.db.get(key, cf.name) proc put*( - cf: ColFamilyReadWrite, - key, val: openArray[byte]): RocksDBResult[void] {.inline.} = + cf: ColFamilyReadWrite, key, val: openArray[byte] +): RocksDBResult[void] {.inline.} = ## Puts a value for the given key into the column family. cf.db.put(key, val, cf.name) proc keyExists*( - cf: ColFamilyReadOnly | ColFamilyReadWrite, - key: openArray[byte]): RocksDBResult[bool] {.inline.} = + cf: ColFamilyReadOnly | ColFamilyReadWrite, key: openArray[byte] +): RocksDBResult[bool] {.inline.} = ## Checks if the given key exists in the column family. cf.db.keyExists(key, cf.name) proc delete*( - cf: ColFamilyReadWrite, - key: openArray[byte]): RocksDBResult[void] {.inline.} = + cf: ColFamilyReadWrite, key: openArray[byte] +): RocksDBResult[void] {.inline.} = ## Deletes the given key from the column family. cf.db.delete(key, cf.name) proc openIterator*( - cf: ColFamilyReadOnly | ColFamilyReadWrite): RocksDBResult[RocksIteratorRef] {.inline.} = + cf: ColFamilyReadOnly | ColFamilyReadWrite +): RocksDBResult[RocksIteratorRef] {.inline.} = ## Opens an `RocksIteratorRef` for the given column family. cf.db.openIterator(cf.name) @@ -107,7 +106,7 @@ proc openWriteBatch*(cf: ColFamilyReadWrite): WriteBatchRef {.inline.} = cf.db.openWriteBatch(cf.name) proc write*( - cf: ColFamilyReadWrite, - updates: WriteBatchRef): RocksDBResult[void] {.inline.} = + cf: ColFamilyReadWrite, updates: WriteBatchRef +): RocksDBResult[void] {.inline.} = ## Writes the updates in the `WriteBatchRef` to the column family. cf.db.write(updates) diff --git a/rocksdb/columnfamily/cfdescriptor.nim b/rocksdb/columnfamily/cfdescriptor.nim index d9b7b3d..3c40579 100644 --- a/rocksdb/columnfamily/cfdescriptor.nim +++ b/rocksdb/columnfamily/cfdescriptor.nim @@ -9,20 +9,17 @@ {.push raises: [].} -import - ../internal/utils, - ./cfopts +import ../internal/utils, ./cfopts export cfopts -type - ColFamilyDescriptor* = object - name: string - options: ColFamilyOptionsRef +type ColFamilyDescriptor* = object + name: string + options: ColFamilyOptionsRef proc initColFamilyDescriptor*( - name: string, - options = defaultColFamilyOptions()): ColFamilyDescriptor = + name: string, options = defaultColFamilyOptions() +): ColFamilyDescriptor = ColFamilyDescriptor(name: name, options: options) proc name*(descriptor: ColFamilyDescriptor): string {.inline.} = diff --git a/rocksdb/columnfamily/cfhandle.nim b/rocksdb/columnfamily/cfhandle.nim index 57d4f51..abb6d01 100644 --- a/rocksdb/columnfamily/cfhandle.nim +++ b/rocksdb/columnfamily/cfhandle.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb +import ../lib/librocksdb type ColFamilyHandlePtr* = ptr rocksdb_column_family_handle_t diff --git a/rocksdb/columnfamily/cfopts.nim b/rocksdb/columnfamily/cfopts.nim index d4c9ab1..cba148d 100644 --- a/rocksdb/columnfamily/cfopts.nim +++ b/rocksdb/columnfamily/cfopts.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb, ../options/tableopts +import ../lib/librocksdb, ../options/tableopts type SlicetransformPtr* = ptr rocksdb_slicetransform_t @@ -127,21 +126,23 @@ proc `setPrefixExtractor`*(cfOpts: ColFamilyOptionsRef, value: SlicetransformRef doAssert not cfOpts.isClosed() rocksdb_options_set_prefix_extractor(cfOpts.cPtr, value.cPtr) -proc `blockBasedTableFactory=`*(cfOpts: ColFamilyOptionsRef, tableOpts: TableOptionsRef) = +proc `blockBasedTableFactory=`*( + cfOpts: ColFamilyOptionsRef, tableOpts: TableOptionsRef +) = doAssert not cfOpts.isClosed() rocksdb_options_set_block_based_table_factory(cfOpts.cPtr, tableOpts.cPtr) # https://github.com/facebook/rocksdb/wiki/MemTable proc setHashSkipListRep*( - cfOpts: ColFamilyOptionsRef, bucketCount, skipListHeight, - skipListBranchingFactor: int) = + cfOpts: ColFamilyOptionsRef, + bucketCount, skipListHeight, skipListBranchingFactor: int, +) = doAssert not cfOpts.isClosed() rocksdb_options_set_hash_skip_list_rep( - cfOpts.cPtr, bucketCount.csize_t, skipListHeight.cint, - skipListBranchingFactor.cint) + cfOpts.cPtr, bucketCount.csize_t, skipListHeight.cint, skipListBranchingFactor.cint + ) -proc setHashLinkListRep*( - cfOpts: ColFamilyOptionsRef, bucketCount: int) = +proc setHashLinkListRep*(cfOpts: ColFamilyOptionsRef, bucketCount: int) = doAssert not cfOpts.isClosed() rocksdb_options_set_hash_link_list_rep(cfOpts.cPtr, bucketCount.csize_t) diff --git a/rocksdb/internal/cftable.nim b/rocksdb/internal/cftable.nim index 08286c9..87d5d8b 100644 --- a/rocksdb/internal/cftable.nim +++ b/rocksdb/internal/cftable.nim @@ -9,23 +9,19 @@ {.push raises: [].} -import - std/tables, - ../columnfamily/cfhandle +import std/tables, ../columnfamily/cfhandle -export - cfhandle +export cfhandle -type - ColFamilyTableRef* = ref object - columnFamilies: TableRef[string, ColFamilyHandleRef] +type ColFamilyTableRef* = ref object + columnFamilies: TableRef[string, ColFamilyHandleRef] proc newColFamilyTable*( - names: openArray[string], - handles: openArray[ColFamilyHandlePtr]): ColFamilyTableRef = + names: openArray[string], handles: openArray[ColFamilyHandlePtr] +): ColFamilyTableRef = doAssert names.len() == handles.len() - let cfTable = newTable[string, ColFamilyHandleRef]() + let cfTable = newTable[string, ColFamilyHandleRef]() for i, name in names: cfTable[name] = newColFamilyHandle(handles[i]) diff --git a/rocksdb/internal/utils.nim b/rocksdb/internal/utils.nim index 76f33db..cc4a21a 100644 --- a/rocksdb/internal/utils.nim +++ b/rocksdb/internal/utils.nim @@ -9,9 +9,7 @@ {.push raises: [].} -import - std/locks, - ../lib/librocksdb +import std/locks, ../lib/librocksdb const DEFAULT_COLUMN_FAMILY_NAME* = "default" diff --git a/rocksdb/lib/rocksdb_gen.nim b/rocksdb/lib/rocksdb_gen.nim index 85974fb..65a77df 100644 --- a/rocksdb/lib/rocksdb_gen.nim +++ b/rocksdb/lib/rocksdb_gen.nim @@ -42,352 +42,683 @@ ## when defined(windows): - const - librocksdb* = "librocksdb.dll" + const librocksdb* = "librocksdb.dll" elif defined(macosx): - const - librocksdb* = "librocksdb.dylib" + const librocksdb* = "librocksdb.dylib" else: - const - librocksdb* = "librocksdb.so" + const librocksdb* = "librocksdb.so" ## Exported types - ## DB operations -proc rocksdb_open*(options: ptr rocksdb_options_t; name: cstring; errptr: cstringArray): ptr rocksdb_t {. - cdecl, importc: "rocksdb_open", dynlib: librocksdb.} -proc rocksdb_open_with_ttl*(options: ptr rocksdb_options_t; name: cstring; ttl: cint; - errptr: cstringArray): ptr rocksdb_t {.cdecl, - importc: "rocksdb_open_with_ttl", dynlib: librocksdb.} -proc rocksdb_open_for_read_only*(options: ptr rocksdb_options_t; name: cstring; - error_if_wal_file_exists: uint8; - errptr: cstringArray): ptr rocksdb_t {.cdecl, - importc: "rocksdb_open_for_read_only", dynlib: librocksdb.} -proc rocksdb_open_as_secondary*(options: ptr rocksdb_options_t; name: cstring; - secondary_path: cstring; errptr: cstringArray): ptr rocksdb_t {. - cdecl, importc: "rocksdb_open_as_secondary", dynlib: librocksdb.} -proc rocksdb_backup_engine_open*(options: ptr rocksdb_options_t; path: cstring; - errptr: cstringArray): ptr rocksdb_backup_engine_t {. - cdecl, importc: "rocksdb_backup_engine_open", dynlib: librocksdb.} -proc rocksdb_backup_engine_open_opts*(options: ptr rocksdb_backup_engine_options_t; - env: ptr rocksdb_env_t; errptr: cstringArray): ptr rocksdb_backup_engine_t {. - cdecl, importc: "rocksdb_backup_engine_open_opts", dynlib: librocksdb.} -proc rocksdb_backup_engine_create_new_backup*(be: ptr rocksdb_backup_engine_t; - db: ptr rocksdb_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_backup_engine_create_new_backup", dynlib: librocksdb.} +proc rocksdb_open*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +): ptr rocksdb_t {.cdecl, importc: "rocksdb_open", dynlib: librocksdb.} + +proc rocksdb_open_with_ttl*( + options: ptr rocksdb_options_t, name: cstring, ttl: cint, errptr: cstringArray +): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_with_ttl", dynlib: librocksdb.} + +proc rocksdb_open_for_read_only*( + options: ptr rocksdb_options_t, + name: cstring, + error_if_wal_file_exists: uint8, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_for_read_only", dynlib: librocksdb.} + +proc rocksdb_open_as_secondary*( + options: ptr rocksdb_options_t, + name: cstring, + secondary_path: cstring, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_as_secondary", dynlib: librocksdb.} + +proc rocksdb_backup_engine_open*( + options: ptr rocksdb_options_t, path: cstring, errptr: cstringArray +): ptr rocksdb_backup_engine_t {. + cdecl, importc: "rocksdb_backup_engine_open", dynlib: librocksdb +.} + +proc rocksdb_backup_engine_open_opts*( + options: ptr rocksdb_backup_engine_options_t, + env: ptr rocksdb_env_t, + errptr: cstringArray, +): ptr rocksdb_backup_engine_t {. + cdecl, importc: "rocksdb_backup_engine_open_opts", dynlib: librocksdb +.} + +proc rocksdb_backup_engine_create_new_backup*( + be: ptr rocksdb_backup_engine_t, db: ptr rocksdb_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_backup_engine_create_new_backup", dynlib: librocksdb.} + proc rocksdb_backup_engine_create_new_backup_flush*( - be: ptr rocksdb_backup_engine_t; db: ptr rocksdb_t; flush_before_backup: uint8; - errptr: cstringArray) {.cdecl, importc: "rocksdb_backup_engine_create_new_backup_flush", - dynlib: librocksdb.} -proc rocksdb_backup_engine_purge_old_backups*(be: ptr rocksdb_backup_engine_t; - num_backups_to_keep: uint32; errptr: cstringArray) {.cdecl, - importc: "rocksdb_backup_engine_purge_old_backups", dynlib: librocksdb.} -proc rocksdb_restore_options_create*(): ptr rocksdb_restore_options_t {.cdecl, - importc: "rocksdb_restore_options_create", dynlib: librocksdb.} -proc rocksdb_restore_options_destroy*(opt: ptr rocksdb_restore_options_t) {.cdecl, - importc: "rocksdb_restore_options_destroy", dynlib: librocksdb.} + be: ptr rocksdb_backup_engine_t, + db: ptr rocksdb_t, + flush_before_backup: uint8, + errptr: cstringArray, +) {. + cdecl, importc: "rocksdb_backup_engine_create_new_backup_flush", dynlib: librocksdb +.} + +proc rocksdb_backup_engine_purge_old_backups*( + be: ptr rocksdb_backup_engine_t, num_backups_to_keep: uint32, errptr: cstringArray +) {.cdecl, importc: "rocksdb_backup_engine_purge_old_backups", dynlib: librocksdb.} + +proc rocksdb_restore_options_create*(): ptr rocksdb_restore_options_t {. + cdecl, importc: "rocksdb_restore_options_create", dynlib: librocksdb +.} + +proc rocksdb_restore_options_destroy*( + opt: ptr rocksdb_restore_options_t +) {.cdecl, importc: "rocksdb_restore_options_destroy", dynlib: librocksdb.} + proc rocksdb_restore_options_set_keep_log_files*( - opt: ptr rocksdb_restore_options_t; v: cint) {.cdecl, - importc: "rocksdb_restore_options_set_keep_log_files", dynlib: librocksdb.} -proc rocksdb_backup_engine_verify_backup*(be: ptr rocksdb_backup_engine_t; - backup_id: uint32; errptr: cstringArray) {.cdecl, - importc: "rocksdb_backup_engine_verify_backup", dynlib: librocksdb.} + opt: ptr rocksdb_restore_options_t, v: cint +) {.cdecl, importc: "rocksdb_restore_options_set_keep_log_files", dynlib: librocksdb.} + +proc rocksdb_backup_engine_verify_backup*( + be: ptr rocksdb_backup_engine_t, backup_id: uint32, errptr: cstringArray +) {.cdecl, importc: "rocksdb_backup_engine_verify_backup", dynlib: librocksdb.} + proc rocksdb_backup_engine_restore_db_from_latest_backup*( - be: ptr rocksdb_backup_engine_t; db_dir: cstring; wal_dir: cstring; - restore_options: ptr rocksdb_restore_options_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_backup_engine_restore_db_from_latest_backup", - dynlib: librocksdb.} + be: ptr rocksdb_backup_engine_t, + db_dir: cstring, + wal_dir: cstring, + restore_options: ptr rocksdb_restore_options_t, + errptr: cstringArray, +) {. + cdecl, + importc: "rocksdb_backup_engine_restore_db_from_latest_backup", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_restore_db_from_backup*( - be: ptr rocksdb_backup_engine_t; db_dir: cstring; wal_dir: cstring; - restore_options: ptr rocksdb_restore_options_t; backup_id: uint32; - errptr: cstringArray) {.cdecl, importc: "rocksdb_backup_engine_restore_db_from_backup", - dynlib: librocksdb.} -proc rocksdb_backup_engine_get_backup_info*(be: ptr rocksdb_backup_engine_t): ptr rocksdb_backup_engine_info_t {. - cdecl, importc: "rocksdb_backup_engine_get_backup_info", dynlib: librocksdb.} -proc rocksdb_backup_engine_info_count*(info: ptr rocksdb_backup_engine_info_t): cint {. - cdecl, importc: "rocksdb_backup_engine_info_count", dynlib: librocksdb.} + be: ptr rocksdb_backup_engine_t, + db_dir: cstring, + wal_dir: cstring, + restore_options: ptr rocksdb_restore_options_t, + backup_id: uint32, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_backup_engine_restore_db_from_backup", dynlib: librocksdb.} + +proc rocksdb_backup_engine_get_backup_info*( + be: ptr rocksdb_backup_engine_t +): ptr rocksdb_backup_engine_info_t {. + cdecl, importc: "rocksdb_backup_engine_get_backup_info", dynlib: librocksdb +.} + +proc rocksdb_backup_engine_info_count*( + info: ptr rocksdb_backup_engine_info_t +): cint {.cdecl, importc: "rocksdb_backup_engine_info_count", dynlib: librocksdb.} + proc rocksdb_backup_engine_info_timestamp*( - info: ptr rocksdb_backup_engine_info_t; index: cint): int64 {.cdecl, - importc: "rocksdb_backup_engine_info_timestamp", dynlib: librocksdb.} + info: ptr rocksdb_backup_engine_info_t, index: cint +): int64 {.cdecl, importc: "rocksdb_backup_engine_info_timestamp", dynlib: librocksdb.} + proc rocksdb_backup_engine_info_backup_id*( - info: ptr rocksdb_backup_engine_info_t; index: cint): uint32 {.cdecl, - importc: "rocksdb_backup_engine_info_backup_id", dynlib: librocksdb.} -proc rocksdb_backup_engine_info_size*(info: ptr rocksdb_backup_engine_info_t; - index: cint): uint64 {.cdecl, - importc: "rocksdb_backup_engine_info_size", dynlib: librocksdb.} + info: ptr rocksdb_backup_engine_info_t, index: cint +): uint32 {.cdecl, importc: "rocksdb_backup_engine_info_backup_id", dynlib: librocksdb.} + +proc rocksdb_backup_engine_info_size*( + info: ptr rocksdb_backup_engine_info_t, index: cint +): uint64 {.cdecl, importc: "rocksdb_backup_engine_info_size", dynlib: librocksdb.} + proc rocksdb_backup_engine_info_number_files*( - info: ptr rocksdb_backup_engine_info_t; index: cint): uint32 {.cdecl, - importc: "rocksdb_backup_engine_info_number_files", dynlib: librocksdb.} -proc rocksdb_backup_engine_info_destroy*(info: ptr rocksdb_backup_engine_info_t) {. - cdecl, importc: "rocksdb_backup_engine_info_destroy", dynlib: librocksdb.} -proc rocksdb_backup_engine_close*(be: ptr rocksdb_backup_engine_t) {.cdecl, - importc: "rocksdb_backup_engine_close", dynlib: librocksdb.} -proc rocksdb_put_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; ts: cstring; tslen: csize_t; - val: cstring; vallen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_put_with_ts", dynlib: librocksdb.} -proc rocksdb_put_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_put_cf_with_ts", dynlib: librocksdb.} -proc rocksdb_delete_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_delete_with_ts", dynlib: librocksdb.} -proc rocksdb_delete_cf_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_delete_cf_with_ts", dynlib: librocksdb.} -proc rocksdb_singledelete*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_singledelete", dynlib: librocksdb.} -proc rocksdb_singledelete_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_singledelete_cf", dynlib: librocksdb.} -proc rocksdb_singledelete_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_singledelete_with_ts", dynlib: librocksdb.} -proc rocksdb_singledelete_cf_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - ts: cstring; tslen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_singledelete_cf_with_ts", dynlib: librocksdb.} -proc rocksdb_increase_full_history_ts_low*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t; ts_low: cstring; - ts_lowlen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_increase_full_history_ts_low", dynlib: librocksdb.} -proc rocksdb_get_full_history_ts_low*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - ts_lowlen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl, importc: "rocksdb_get_full_history_ts_low", dynlib: librocksdb.} + info: ptr rocksdb_backup_engine_info_t, index: cint +): uint32 {. + cdecl, importc: "rocksdb_backup_engine_info_number_files", dynlib: librocksdb +.} + +proc rocksdb_backup_engine_info_destroy*( + info: ptr rocksdb_backup_engine_info_t +) {.cdecl, importc: "rocksdb_backup_engine_info_destroy", dynlib: librocksdb.} + +proc rocksdb_backup_engine_close*( + be: ptr rocksdb_backup_engine_t +) {.cdecl, importc: "rocksdb_backup_engine_close", dynlib: librocksdb.} + +proc rocksdb_put_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_put_with_ts", dynlib: librocksdb.} + +proc rocksdb_put_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_put_cf_with_ts", dynlib: librocksdb.} + +proc rocksdb_delete_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete_with_ts", dynlib: librocksdb.} + +proc rocksdb_delete_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete_cf_with_ts", dynlib: librocksdb.} + +proc rocksdb_singledelete*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_singledelete", dynlib: librocksdb.} + +proc rocksdb_singledelete_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_singledelete_cf", dynlib: librocksdb.} + +proc rocksdb_singledelete_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_singledelete_with_ts", dynlib: librocksdb.} + +proc rocksdb_singledelete_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_singledelete_cf_with_ts", dynlib: librocksdb.} + +proc rocksdb_increase_full_history_ts_low*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + ts_low: cstring, + ts_lowlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_increase_full_history_ts_low", dynlib: librocksdb.} + +proc rocksdb_get_full_history_ts_low*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + ts_lowlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_get_full_history_ts_low", dynlib: librocksdb.} + ## BackupEngineOptions -proc rocksdb_backup_engine_options_create*(backup_dir: cstring): ptr rocksdb_backup_engine_options_t {. - cdecl, importc: "rocksdb_backup_engine_options_create", dynlib: librocksdb.} +proc rocksdb_backup_engine_options_create*( + backup_dir: cstring +): ptr rocksdb_backup_engine_options_t {. + cdecl, importc: "rocksdb_backup_engine_options_create", dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_backup_dir*( - options: ptr rocksdb_backup_engine_options_t; backup_dir: cstring) {.cdecl, - importc: "rocksdb_backup_engine_options_set_backup_dir", dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, backup_dir: cstring +) {.cdecl, importc: "rocksdb_backup_engine_options_set_backup_dir", dynlib: librocksdb.} + proc rocksdb_backup_engine_options_set_env*( - options: ptr rocksdb_backup_engine_options_t; env: ptr rocksdb_env_t) {.cdecl, - importc: "rocksdb_backup_engine_options_set_env", dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, env: ptr rocksdb_env_t +) {.cdecl, importc: "rocksdb_backup_engine_options_set_env", dynlib: librocksdb.} + proc rocksdb_backup_engine_options_set_share_table_files*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl, - importc: "rocksdb_backup_engine_options_set_share_table_files", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_share_table_files", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_share_table_files*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl, - importc: "rocksdb_backup_engine_options_get_share_table_files", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {. + cdecl, + importc: "rocksdb_backup_engine_options_get_share_table_files", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_sync*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl, - importc: "rocksdb_backup_engine_options_set_sync", dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {.cdecl, importc: "rocksdb_backup_engine_options_set_sync", dynlib: librocksdb.} + proc rocksdb_backup_engine_options_get_sync*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl, - importc: "rocksdb_backup_engine_options_get_sync", dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {. + cdecl, importc: "rocksdb_backup_engine_options_get_sync", dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_destroy_old_data*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl, - importc: "rocksdb_backup_engine_options_set_destroy_old_data", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_destroy_old_data", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_destroy_old_data*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl, - importc: "rocksdb_backup_engine_options_get_destroy_old_data", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {. + cdecl, + importc: "rocksdb_backup_engine_options_get_destroy_old_data", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_backup_log_files*( - options: ptr rocksdb_backup_engine_options_t; val: uint8) {.cdecl, - importc: "rocksdb_backup_engine_options_set_backup_log_files", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: uint8 +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_backup_log_files", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_backup_log_files*( - options: ptr rocksdb_backup_engine_options_t): uint8 {.cdecl, - importc: "rocksdb_backup_engine_options_get_backup_log_files", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint8 {. + cdecl, + importc: "rocksdb_backup_engine_options_get_backup_log_files", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_backup_rate_limit*( - options: ptr rocksdb_backup_engine_options_t; limit: uint64) {.cdecl, - importc: "rocksdb_backup_engine_options_set_backup_rate_limit", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, limit: uint64 +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_backup_rate_limit", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_backup_rate_limit*( - options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl, - importc: "rocksdb_backup_engine_options_get_backup_rate_limit", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint64 {. + cdecl, + importc: "rocksdb_backup_engine_options_get_backup_rate_limit", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_restore_rate_limit*( - options: ptr rocksdb_backup_engine_options_t; limit: uint64) {.cdecl, - importc: "rocksdb_backup_engine_options_set_restore_rate_limit", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, limit: uint64 +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_restore_rate_limit", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_restore_rate_limit*( - options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl, - importc: "rocksdb_backup_engine_options_get_restore_rate_limit", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint64 {. + cdecl, + importc: "rocksdb_backup_engine_options_get_restore_rate_limit", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_max_background_operations*( - options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl, - importc: "rocksdb_backup_engine_options_set_max_background_operations", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: cint +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_max_background_operations", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_max_background_operations*( - options: ptr rocksdb_backup_engine_options_t): cint {.cdecl, - importc: "rocksdb_backup_engine_options_get_max_background_operations", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): cint {. + cdecl, + importc: "rocksdb_backup_engine_options_get_max_background_operations", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_callback_trigger_interval_size*( - options: ptr rocksdb_backup_engine_options_t; size: uint64) {.cdecl, importc: "rocksdb_backup_engine_options_set_callback_trigger_interval_size", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, size: uint64 +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_callback_trigger_interval_size", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_callback_trigger_interval_size*( - options: ptr rocksdb_backup_engine_options_t): uint64 {.cdecl, importc: "rocksdb_backup_engine_options_get_callback_trigger_interval_size", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): uint64 {. + cdecl, + importc: "rocksdb_backup_engine_options_get_callback_trigger_interval_size", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_max_valid_backups_to_open*( - options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl, - importc: "rocksdb_backup_engine_options_set_max_valid_backups_to_open", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: cint +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_max_valid_backups_to_open", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_max_valid_backups_to_open*( - options: ptr rocksdb_backup_engine_options_t): cint {.cdecl, - importc: "rocksdb_backup_engine_options_get_max_valid_backups_to_open", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): cint {. + cdecl, + importc: "rocksdb_backup_engine_options_get_max_valid_backups_to_open", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_set_share_files_with_checksum_naming*( - options: ptr rocksdb_backup_engine_options_t; val: cint) {.cdecl, importc: "rocksdb_backup_engine_options_set_share_files_with_checksum_naming", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t, val: cint +) {. + cdecl, + importc: "rocksdb_backup_engine_options_set_share_files_with_checksum_naming", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_get_share_files_with_checksum_naming*( - options: ptr rocksdb_backup_engine_options_t): cint {.cdecl, importc: "rocksdb_backup_engine_options_get_share_files_with_checksum_naming", - dynlib: librocksdb.} + options: ptr rocksdb_backup_engine_options_t +): cint {. + cdecl, + importc: "rocksdb_backup_engine_options_get_share_files_with_checksum_naming", + dynlib: librocksdb +.} + proc rocksdb_backup_engine_options_destroy*( - a1: ptr rocksdb_backup_engine_options_t) {.cdecl, - importc: "rocksdb_backup_engine_options_destroy", dynlib: librocksdb.} + a1: ptr rocksdb_backup_engine_options_t +) {.cdecl, importc: "rocksdb_backup_engine_options_destroy", dynlib: librocksdb.} + ## Checkpoint -proc rocksdb_checkpoint_object_create*(db: ptr rocksdb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. - cdecl, importc: "rocksdb_checkpoint_object_create", dynlib: librocksdb.} -proc rocksdb_checkpoint_create*(checkpoint: ptr rocksdb_checkpoint_t; - checkpoint_dir: cstring; - log_size_for_flush: uint64; errptr: cstringArray) {. - cdecl, importc: "rocksdb_checkpoint_create", dynlib: librocksdb.} -proc rocksdb_checkpoint_object_destroy*(checkpoint: ptr rocksdb_checkpoint_t) {. - cdecl, importc: "rocksdb_checkpoint_object_destroy", dynlib: librocksdb.} -proc rocksdb_open_and_trim_history*(options: ptr rocksdb_options_t; name: cstring; - num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; column_family_handles: ptr ptr rocksdb_column_family_handle_t; - trim_ts: cstring; trim_tslen: csize_t; - errptr: cstringArray): ptr rocksdb_t {.cdecl, - importc: "rocksdb_open_and_trim_history", dynlib: librocksdb.} -proc rocksdb_open_column_families*(options: ptr rocksdb_options_t; name: cstring; - num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_t {.cdecl, - importc: "rocksdb_open_column_families", dynlib: librocksdb.} -proc rocksdb_open_column_families_with_ttl*(options: ptr rocksdb_options_t; - name: cstring; num_column_families: cint; column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; ttls: ptr cint; - errptr: cstringArray): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_column_families_with_ttl", - dynlib: librocksdb.} -proc rocksdb_open_for_read_only_column_families*(options: ptr rocksdb_options_t; - name: cstring; num_column_families: cint; column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - error_if_wal_file_exists: uint8; errptr: cstringArray): ptr rocksdb_t {.cdecl, - importc: "rocksdb_open_for_read_only_column_families", dynlib: librocksdb.} -proc rocksdb_open_as_secondary_column_families*(options: ptr rocksdb_options_t; - name: cstring; secondary_path: cstring; num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_as_secondary_column_families", - dynlib: librocksdb.} -proc rocksdb_list_column_families*(options: ptr rocksdb_options_t; name: cstring; - lencf: ptr csize_t; errptr: cstringArray): cstringArray {. - cdecl, importc: "rocksdb_list_column_families", dynlib: librocksdb.} -proc rocksdb_list_column_families_destroy*(list: cstringArray; len: csize_t) {.cdecl, - importc: "rocksdb_list_column_families_destroy", dynlib: librocksdb.} -proc rocksdb_create_column_family*(db: ptr rocksdb_t; - column_family_options: ptr rocksdb_options_t; - column_family_name: cstring; - errptr: cstringArray): ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_create_column_family", dynlib: librocksdb.} -proc rocksdb_create_column_families*(db: ptr rocksdb_t; column_family_options: ptr rocksdb_options_t; - num_column_families: cint; - column_family_names: cstringArray; - lencfs: ptr csize_t; errptr: cstringArray): ptr ptr rocksdb_column_family_handle_t {. - cdecl, importc: "rocksdb_create_column_families", dynlib: librocksdb.} +proc rocksdb_checkpoint_object_create*( + db: ptr rocksdb_t, errptr: cstringArray +): ptr rocksdb_checkpoint_t {. + cdecl, importc: "rocksdb_checkpoint_object_create", dynlib: librocksdb +.} + +proc rocksdb_checkpoint_create*( + checkpoint: ptr rocksdb_checkpoint_t, + checkpoint_dir: cstring, + log_size_for_flush: uint64, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_checkpoint_create", dynlib: librocksdb.} + +proc rocksdb_checkpoint_object_destroy*( + checkpoint: ptr rocksdb_checkpoint_t +) {.cdecl, importc: "rocksdb_checkpoint_object_destroy", dynlib: librocksdb.} + +proc rocksdb_open_and_trim_history*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + trim_ts: cstring, + trim_tslen: csize_t, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_and_trim_history", dynlib: librocksdb.} + +proc rocksdb_open_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_t {.cdecl, importc: "rocksdb_open_column_families", dynlib: librocksdb.} + +proc rocksdb_open_column_families_with_ttl*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + ttls: ptr cint, + errptr: cstringArray, +): ptr rocksdb_t {. + cdecl, importc: "rocksdb_open_column_families_with_ttl", dynlib: librocksdb +.} + +proc rocksdb_open_for_read_only_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + error_if_wal_file_exists: uint8, + errptr: cstringArray, +): ptr rocksdb_t {. + cdecl, importc: "rocksdb_open_for_read_only_column_families", dynlib: librocksdb +.} + +proc rocksdb_open_as_secondary_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + secondary_path: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_t {. + cdecl, importc: "rocksdb_open_as_secondary_column_families", dynlib: librocksdb +.} + +proc rocksdb_list_column_families*( + options: ptr rocksdb_options_t, + name: cstring, + lencf: ptr csize_t, + errptr: cstringArray, +): cstringArray {.cdecl, importc: "rocksdb_list_column_families", dynlib: librocksdb.} + +proc rocksdb_list_column_families_destroy*( + list: cstringArray, len: csize_t +) {.cdecl, importc: "rocksdb_list_column_families_destroy", dynlib: librocksdb.} + +proc rocksdb_create_column_family*( + db: ptr rocksdb_t, + column_family_options: ptr rocksdb_options_t, + column_family_name: cstring, + errptr: cstringArray, +): ptr rocksdb_column_family_handle_t {. + cdecl, importc: "rocksdb_create_column_family", dynlib: librocksdb +.} + +proc rocksdb_create_column_families*( + db: ptr rocksdb_t, + column_family_options: ptr rocksdb_options_t, + num_column_families: cint, + column_family_names: cstringArray, + lencfs: ptr csize_t, + errptr: cstringArray, +): ptr ptr rocksdb_column_family_handle_t {. + cdecl, importc: "rocksdb_create_column_families", dynlib: librocksdb +.} + proc rocksdb_create_column_families_destroy*( - list: ptr ptr rocksdb_column_family_handle_t) {.cdecl, - importc: "rocksdb_create_column_families_destroy", dynlib: librocksdb.} -proc rocksdb_create_column_family_with_ttl*(db: ptr rocksdb_t; - column_family_options: ptr rocksdb_options_t; column_family_name: cstring; - ttl: cint; errptr: cstringArray): ptr rocksdb_column_family_handle_t {.cdecl, - importc: "rocksdb_create_column_family_with_ttl", dynlib: librocksdb.} -proc rocksdb_drop_column_family*(db: ptr rocksdb_t; - handle: ptr rocksdb_column_family_handle_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_drop_column_family", dynlib: librocksdb.} -proc rocksdb_column_family_handle_destroy*(a1: ptr rocksdb_column_family_handle_t) {. - cdecl, importc: "rocksdb_column_family_handle_destroy", dynlib: librocksdb.} + list: ptr ptr rocksdb_column_family_handle_t +) {.cdecl, importc: "rocksdb_create_column_families_destroy", dynlib: librocksdb.} + +proc rocksdb_create_column_family_with_ttl*( + db: ptr rocksdb_t, + column_family_options: ptr rocksdb_options_t, + column_family_name: cstring, + ttl: cint, + errptr: cstringArray, +): ptr rocksdb_column_family_handle_t {. + cdecl, importc: "rocksdb_create_column_family_with_ttl", dynlib: librocksdb +.} + +proc rocksdb_drop_column_family*( + db: ptr rocksdb_t, handle: ptr rocksdb_column_family_handle_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_drop_column_family", dynlib: librocksdb.} + +proc rocksdb_column_family_handle_destroy*( + a1: ptr rocksdb_column_family_handle_t +) {.cdecl, importc: "rocksdb_column_family_handle_destroy", dynlib: librocksdb.} + proc rocksdb_column_family_handle_get_id*( - handle: ptr rocksdb_column_family_handle_t): uint32 {.cdecl, - importc: "rocksdb_column_family_handle_get_id", dynlib: librocksdb.} + handle: ptr rocksdb_column_family_handle_t +): uint32 {.cdecl, importc: "rocksdb_column_family_handle_get_id", dynlib: librocksdb.} + proc rocksdb_column_family_handle_get_name*( - handle: ptr rocksdb_column_family_handle_t; name_len: ptr csize_t): cstring {. - cdecl, importc: "rocksdb_column_family_handle_get_name", dynlib: librocksdb.} -proc rocksdb_close*(db: ptr rocksdb_t) {.cdecl, importc: "rocksdb_close", - dynlib: librocksdb.} -proc rocksdb_put*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_put", dynlib: librocksdb.} -proc rocksdb_put_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, importc: "rocksdb_put_cf", - dynlib: librocksdb.} -proc rocksdb_delete*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_delete", dynlib: librocksdb.} -proc rocksdb_delete_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_delete_cf", dynlib: librocksdb.} -proc rocksdb_delete_range_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - end_key: cstring; end_key_len: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_delete_range_cf", dynlib: librocksdb.} -proc rocksdb_merge*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, importc: "rocksdb_merge", - dynlib: librocksdb.} -proc rocksdb_merge_cf*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, importc: "rocksdb_merge_cf", - dynlib: librocksdb.} -proc rocksdb_write*(db: ptr rocksdb_t; options: ptr rocksdb_writeoptions_t; - batch: ptr rocksdb_writebatch_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_write", dynlib: librocksdb.} + handle: ptr rocksdb_column_family_handle_t, name_len: ptr csize_t +): cstring {. + cdecl, importc: "rocksdb_column_family_handle_get_name", dynlib: librocksdb +.} + +proc rocksdb_close*( + db: ptr rocksdb_t +) {.cdecl, importc: "rocksdb_close", dynlib: librocksdb.} + +proc rocksdb_put*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_put", dynlib: librocksdb.} + +proc rocksdb_put_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_put_cf", dynlib: librocksdb.} + +proc rocksdb_delete*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete", dynlib: librocksdb.} + +proc rocksdb_delete_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete_cf", dynlib: librocksdb.} + +proc rocksdb_delete_range_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete_range_cf", dynlib: librocksdb.} + +proc rocksdb_merge*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_merge", dynlib: librocksdb.} + +proc rocksdb_merge_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_merge_cf", dynlib: librocksdb.} + +proc rocksdb_write*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + batch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_write", dynlib: librocksdb.} + ## Returns NULL if not found. A malloc()ed array otherwise. ## Stores the length of the array in *vallen. -proc rocksdb_get*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; key: cstring; - keylen: csize_t; vallen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl, importc: "rocksdb_get", dynlib: librocksdb.} -proc rocksdb_get_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t; vallen: ptr csize_t; - ts: cstringArray; tslen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl, importc: "rocksdb_get_with_ts", dynlib: librocksdb.} -proc rocksdb_get_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; vallen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_get_cf", dynlib: librocksdb.} -proc rocksdb_get_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; vallen: ptr csize_t; - ts: cstringArray; tslen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_get_cf_with_ts", dynlib: librocksdb.} +proc rocksdb_get*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_get", dynlib: librocksdb.} + +proc rocksdb_get_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + ts: cstringArray, + tslen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_get_with_ts", dynlib: librocksdb.} + +proc rocksdb_get_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_get_cf", dynlib: librocksdb.} + +proc rocksdb_get_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + ts: cstringArray, + tslen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_get_cf_with_ts", dynlib: librocksdb.} + ## if values_list[i] == NULL and errs[i] == NULL, ## then we got status.IsNotFound(), which we will not return. ## all errors except status status.ok() and status.IsNotFound() are returned. @@ -400,38 +731,56 @@ proc rocksdb_get_cf_with_ts*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions ## each non-NULL values_list entry is a malloc()ed array, with ## the length for each stored in values_list_sizes[i]. -proc rocksdb_multi_get*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl, - importc: "rocksdb_multi_get", dynlib: librocksdb.} -proc rocksdb_multi_get_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - timestamp_list: cstringArray; - timestamp_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl, - importc: "rocksdb_multi_get_with_ts", dynlib: librocksdb.} -proc rocksdb_multi_get_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {. - cdecl, importc: "rocksdb_multi_get_cf", dynlib: librocksdb.} -proc rocksdb_multi_get_cf_with_ts*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - timestamps_list: cstringArray; - timestamps_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl, - importc: "rocksdb_multi_get_cf_with_ts", dynlib: librocksdb.} +proc rocksdb_multi_get*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_multi_get", dynlib: librocksdb.} + +proc rocksdb_multi_get_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + timestamp_list: cstringArray, + timestamp_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_multi_get_with_ts", dynlib: librocksdb.} + +proc rocksdb_multi_get_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_multi_get_cf", dynlib: librocksdb.} + +proc rocksdb_multi_get_cf_with_ts*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + timestamps_list: cstringArray, + timestamps_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_multi_get_cf_with_ts", dynlib: librocksdb.} + ## The MultiGet API that improves performance by batching operations ## in the read path for greater efficiency. Currently, only the block based ## table format with full filters are supported. Other table formats such @@ -459,442 +808,824 @@ proc rocksdb_multi_get_cf_with_ts*(db: ptr rocksdb_t; ## internally by the API - the input array will not be ## modified -proc rocksdb_batched_multi_get_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values: ptr ptr rocksdb_pinnableslice_t; - errs: cstringArray; sorted_input: bool) {.cdecl, - importc: "rocksdb_batched_multi_get_cf", dynlib: librocksdb.} +proc rocksdb_batched_multi_get_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values: ptr ptr rocksdb_pinnableslice_t, + errs: cstringArray, + sorted_input: bool, +) {.cdecl, importc: "rocksdb_batched_multi_get_cf", dynlib: librocksdb.} + ## The value is only allocated (using malloc) and returned if it is found and ## value_found isn't NULL. In that case the user is responsible for freeing it. -proc rocksdb_key_may_exist*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - key: cstring; key_len: csize_t; value: cstringArray; - val_len: ptr csize_t; timestamp: cstring; - timestamp_len: csize_t; value_found: ptr uint8): uint8 {. - cdecl, importc: "rocksdb_key_may_exist", dynlib: librocksdb.} +proc rocksdb_key_may_exist*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + key_len: csize_t, + value: cstringArray, + val_len: ptr csize_t, + timestamp: cstring, + timestamp_len: csize_t, + value_found: ptr uint8, +): uint8 {.cdecl, importc: "rocksdb_key_may_exist", dynlib: librocksdb.} + ## The value is only allocated (using malloc) and returned if it is found and ## value_found isn't NULL. In that case the user is responsible for freeing it. -proc rocksdb_key_may_exist_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; key_len: csize_t; value: cstringArray; - val_len: ptr csize_t; timestamp: cstring; - timestamp_len: csize_t; value_found: ptr uint8): uint8 {. - cdecl, importc: "rocksdb_key_may_exist_cf", dynlib: librocksdb.} -proc rocksdb_create_iterator*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_create_iterator", dynlib: librocksdb.} -proc rocksdb_get_updates_since*(db: ptr rocksdb_t; seq_number: uint64; - options: ptr rocksdb_wal_readoptions_t; - errptr: cstringArray): ptr rocksdb_wal_iterator_t {. - cdecl, importc: "rocksdb_get_updates_since", dynlib: librocksdb.} -proc rocksdb_create_iterator_cf*(db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_create_iterator_cf", dynlib: librocksdb.} -proc rocksdb_create_iterators*(db: ptr rocksdb_t; opts: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; - iterators: ptr ptr rocksdb_iterator_t; size: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_create_iterators", dynlib: librocksdb.} -proc rocksdb_create_snapshot*(db: ptr rocksdb_t): ptr rocksdb_snapshot_t {.cdecl, - importc: "rocksdb_create_snapshot", dynlib: librocksdb.} -proc rocksdb_release_snapshot*(db: ptr rocksdb_t; snapshot: ptr rocksdb_snapshot_t) {. - cdecl, importc: "rocksdb_release_snapshot", dynlib: librocksdb.} -proc rocksdb_snapshot_get_sequence_number*(snapshot: ptr rocksdb_snapshot_t): uint64 {. - cdecl, importc: "rocksdb_snapshot_get_sequence_number", dynlib: librocksdb.} +proc rocksdb_key_may_exist_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + key_len: csize_t, + value: cstringArray, + val_len: ptr csize_t, + timestamp: cstring, + timestamp_len: csize_t, + value_found: ptr uint8, +): uint8 {.cdecl, importc: "rocksdb_key_may_exist_cf", dynlib: librocksdb.} + +proc rocksdb_create_iterator*( + db: ptr rocksdb_t, options: ptr rocksdb_readoptions_t +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_create_iterator", dynlib: librocksdb +.} + +proc rocksdb_get_updates_since*( + db: ptr rocksdb_t, + seq_number: uint64, + options: ptr rocksdb_wal_readoptions_t, + errptr: cstringArray, +): ptr rocksdb_wal_iterator_t {. + cdecl, importc: "rocksdb_get_updates_since", dynlib: librocksdb +.} + +proc rocksdb_create_iterator_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_create_iterator_cf", dynlib: librocksdb +.} + +proc rocksdb_create_iterators*( + db: ptr rocksdb_t, + opts: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + iterators: ptr ptr rocksdb_iterator_t, + size: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_create_iterators", dynlib: librocksdb.} + +proc rocksdb_create_snapshot*( + db: ptr rocksdb_t +): ptr rocksdb_snapshot_t {. + cdecl, importc: "rocksdb_create_snapshot", dynlib: librocksdb +.} + +proc rocksdb_release_snapshot*( + db: ptr rocksdb_t, snapshot: ptr rocksdb_snapshot_t +) {.cdecl, importc: "rocksdb_release_snapshot", dynlib: librocksdb.} + +proc rocksdb_snapshot_get_sequence_number*( + snapshot: ptr rocksdb_snapshot_t +): uint64 {.cdecl, importc: "rocksdb_snapshot_get_sequence_number", dynlib: librocksdb.} + ## Returns NULL if property name is unknown. ## Else returns a pointer to a malloc()-ed null-terminated value. -proc rocksdb_property_value*(db: ptr rocksdb_t; propname: cstring): cstring {.cdecl, - importc: "rocksdb_property_value", dynlib: librocksdb.} +proc rocksdb_property_value*( + db: ptr rocksdb_t, propname: cstring +): cstring {.cdecl, importc: "rocksdb_property_value", dynlib: librocksdb.} + ## returns 0 on success, -1 otherwise -proc rocksdb_property_int*(db: ptr rocksdb_t; propname: cstring; out_val: ptr uint64): cint {. - cdecl, importc: "rocksdb_property_int", dynlib: librocksdb.} +proc rocksdb_property_int*( + db: ptr rocksdb_t, propname: cstring, out_val: ptr uint64 +): cint {.cdecl, importc: "rocksdb_property_int", dynlib: librocksdb.} + ## returns 0 on success, -1 otherwise -proc rocksdb_property_int_cf*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t; - propname: cstring; out_val: ptr uint64): cint {.cdecl, - importc: "rocksdb_property_int_cf", dynlib: librocksdb.} -proc rocksdb_property_value_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - propname: cstring): cstring {.cdecl, - importc: "rocksdb_property_value_cf", dynlib: librocksdb.} -proc rocksdb_approximate_sizes*(db: ptr rocksdb_t; num_ranges: cint; - range_start_key: cstringArray; - range_start_key_len: ptr csize_t; - range_limit_key: cstringArray; - range_limit_key_len: ptr csize_t; sizes: ptr uint64; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_approximate_sizes", dynlib: librocksdb.} -proc rocksdb_approximate_sizes_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - num_ranges: cint; range_start_key: cstringArray; - range_start_key_len: ptr csize_t; - range_limit_key: cstringArray; - range_limit_key_len: ptr csize_t; - sizes: ptr uint64; errptr: cstringArray) {.cdecl, - importc: "rocksdb_approximate_sizes_cf", dynlib: librocksdb.} -proc rocksdb_compact_range*(db: ptr rocksdb_t; start_key: cstring; - start_key_len: csize_t; limit_key: cstring; - limit_key_len: csize_t) {.cdecl, - importc: "rocksdb_compact_range", dynlib: librocksdb.} -proc rocksdb_compact_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t) {.cdecl, - importc: "rocksdb_compact_range_cf", dynlib: librocksdb.} -proc rocksdb_suggest_compact_range*(db: ptr rocksdb_t; start_key: cstring; - start_key_len: csize_t; limit_key: cstring; - limit_key_len: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_suggest_compact_range", dynlib: librocksdb.} -proc rocksdb_suggest_compact_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_suggest_compact_range_cf", dynlib: librocksdb.} -proc rocksdb_compact_range_opt*(db: ptr rocksdb_t; - opt: ptr rocksdb_compactoptions_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t) {.cdecl, - importc: "rocksdb_compact_range_opt", dynlib: librocksdb.} -proc rocksdb_compact_range_cf_opt*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - opt: ptr rocksdb_compactoptions_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t) {. - cdecl, importc: "rocksdb_compact_range_cf_opt", dynlib: librocksdb.} -proc rocksdb_delete_file*(db: ptr rocksdb_t; name: cstring) {.cdecl, - importc: "rocksdb_delete_file", dynlib: librocksdb.} -proc rocksdb_livefiles*(db: ptr rocksdb_t): ptr rocksdb_livefiles_t {.cdecl, - importc: "rocksdb_livefiles", dynlib: librocksdb.} -proc rocksdb_flush*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; - errptr: cstringArray) {.cdecl, importc: "rocksdb_flush", - dynlib: librocksdb.} -proc rocksdb_flush_cf*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - errptr: cstringArray) {.cdecl, importc: "rocksdb_flush_cf", - dynlib: librocksdb.} -proc rocksdb_flush_cfs*(db: ptr rocksdb_t; options: ptr rocksdb_flushoptions_t; - column_family: ptr ptr rocksdb_column_family_handle_t; - num_column_families: cint; errptr: cstringArray) {.cdecl, - importc: "rocksdb_flush_cfs", dynlib: librocksdb.} -proc rocksdb_flush_wal*(db: ptr rocksdb_t; sync: uint8; errptr: cstringArray) {.cdecl, - importc: "rocksdb_flush_wal", dynlib: librocksdb.} -proc rocksdb_disable_file_deletions*(db: ptr rocksdb_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_disable_file_deletions", dynlib: librocksdb.} -proc rocksdb_enable_file_deletions*(db: ptr rocksdb_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_enable_file_deletions", dynlib: librocksdb.} +proc rocksdb_property_int_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + propname: cstring, + out_val: ptr uint64, +): cint {.cdecl, importc: "rocksdb_property_int_cf", dynlib: librocksdb.} + +proc rocksdb_property_value_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + propname: cstring, +): cstring {.cdecl, importc: "rocksdb_property_value_cf", dynlib: librocksdb.} + +proc rocksdb_approximate_sizes*( + db: ptr rocksdb_t, + num_ranges: cint, + range_start_key: cstringArray, + range_start_key_len: ptr csize_t, + range_limit_key: cstringArray, + range_limit_key_len: ptr csize_t, + sizes: ptr uint64, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_approximate_sizes", dynlib: librocksdb.} + +proc rocksdb_approximate_sizes_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + num_ranges: cint, + range_start_key: cstringArray, + range_start_key_len: ptr csize_t, + range_limit_key: cstringArray, + range_limit_key_len: ptr csize_t, + sizes: ptr uint64, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_approximate_sizes_cf", dynlib: librocksdb.} + +proc rocksdb_compact_range*( + db: ptr rocksdb_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl, importc: "rocksdb_compact_range", dynlib: librocksdb.} + +proc rocksdb_compact_range_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl, importc: "rocksdb_compact_range_cf", dynlib: librocksdb.} + +proc rocksdb_suggest_compact_range*( + db: ptr rocksdb_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_suggest_compact_range", dynlib: librocksdb.} + +proc rocksdb_suggest_compact_range_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_suggest_compact_range_cf", dynlib: librocksdb.} + +proc rocksdb_compact_range_opt*( + db: ptr rocksdb_t, + opt: ptr rocksdb_compactoptions_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl, importc: "rocksdb_compact_range_opt", dynlib: librocksdb.} + +proc rocksdb_compact_range_cf_opt*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + opt: ptr rocksdb_compactoptions_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, +) {.cdecl, importc: "rocksdb_compact_range_cf_opt", dynlib: librocksdb.} + +proc rocksdb_delete_file*( + db: ptr rocksdb_t, name: cstring +) {.cdecl, importc: "rocksdb_delete_file", dynlib: librocksdb.} + +proc rocksdb_livefiles*( + db: ptr rocksdb_t +): ptr rocksdb_livefiles_t {.cdecl, importc: "rocksdb_livefiles", dynlib: librocksdb.} + +proc rocksdb_flush*( + db: ptr rocksdb_t, options: ptr rocksdb_flushoptions_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_flush", dynlib: librocksdb.} + +proc rocksdb_flush_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_flushoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_flush_cf", dynlib: librocksdb.} + +proc rocksdb_flush_cfs*( + db: ptr rocksdb_t, + options: ptr rocksdb_flushoptions_t, + column_family: ptr ptr rocksdb_column_family_handle_t, + num_column_families: cint, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_flush_cfs", dynlib: librocksdb.} + +proc rocksdb_flush_wal*( + db: ptr rocksdb_t, sync: uint8, errptr: cstringArray +) {.cdecl, importc: "rocksdb_flush_wal", dynlib: librocksdb.} + +proc rocksdb_disable_file_deletions*( + db: ptr rocksdb_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_disable_file_deletions", dynlib: librocksdb.} + +proc rocksdb_enable_file_deletions*( + db: ptr rocksdb_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_enable_file_deletions", dynlib: librocksdb.} + ## Management operations -proc rocksdb_destroy_db*(options: ptr rocksdb_options_t; name: cstring; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_destroy_db", dynlib: librocksdb.} -proc rocksdb_repair_db*(options: ptr rocksdb_options_t; name: cstring; - errptr: cstringArray) {.cdecl, importc: "rocksdb_repair_db", - dynlib: librocksdb.} +proc rocksdb_destroy_db*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +) {.cdecl, importc: "rocksdb_destroy_db", dynlib: librocksdb.} + +proc rocksdb_repair_db*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +) {.cdecl, importc: "rocksdb_repair_db", dynlib: librocksdb.} + ## Iterator -proc rocksdb_iter_destroy*(a1: ptr rocksdb_iterator_t) {.cdecl, - importc: "rocksdb_iter_destroy", dynlib: librocksdb.} -proc rocksdb_iter_valid*(a1: ptr rocksdb_iterator_t): uint8 {.cdecl, - importc: "rocksdb_iter_valid", dynlib: librocksdb.} -proc rocksdb_iter_seek_to_first*(a1: ptr rocksdb_iterator_t) {.cdecl, - importc: "rocksdb_iter_seek_to_first", dynlib: librocksdb.} -proc rocksdb_iter_seek_to_last*(a1: ptr rocksdb_iterator_t) {.cdecl, - importc: "rocksdb_iter_seek_to_last", dynlib: librocksdb.} -proc rocksdb_iter_seek*(a1: ptr rocksdb_iterator_t; k: cstring; klen: csize_t) {.cdecl, - importc: "rocksdb_iter_seek", dynlib: librocksdb.} -proc rocksdb_iter_seek_for_prev*(a1: ptr rocksdb_iterator_t; k: cstring; klen: csize_t) {. - cdecl, importc: "rocksdb_iter_seek_for_prev", dynlib: librocksdb.} -proc rocksdb_iter_next*(a1: ptr rocksdb_iterator_t) {.cdecl, - importc: "rocksdb_iter_next", dynlib: librocksdb.} -proc rocksdb_iter_prev*(a1: ptr rocksdb_iterator_t) {.cdecl, - importc: "rocksdb_iter_prev", dynlib: librocksdb.} -proc rocksdb_iter_key*(a1: ptr rocksdb_iterator_t; klen: ptr csize_t): cstring {.cdecl, - importc: "rocksdb_iter_key", dynlib: librocksdb.} -proc rocksdb_iter_value*(a1: ptr rocksdb_iterator_t; vlen: ptr csize_t): cstring {. - cdecl, importc: "rocksdb_iter_value", dynlib: librocksdb.} -proc rocksdb_iter_timestamp*(a1: ptr rocksdb_iterator_t; tslen: ptr csize_t): cstring {. - cdecl, importc: "rocksdb_iter_timestamp", dynlib: librocksdb.} -proc rocksdb_iter_get_error*(a1: ptr rocksdb_iterator_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_iter_get_error", dynlib: librocksdb.} -proc rocksdb_wal_iter_next*(iter: ptr rocksdb_wal_iterator_t) {.cdecl, - importc: "rocksdb_wal_iter_next", dynlib: librocksdb.} -proc rocksdb_wal_iter_valid*(a1: ptr rocksdb_wal_iterator_t): uint8 {.cdecl, - importc: "rocksdb_wal_iter_valid", dynlib: librocksdb.} -proc rocksdb_wal_iter_status*(iter: ptr rocksdb_wal_iterator_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_wal_iter_status", dynlib: librocksdb.} -proc rocksdb_wal_iter_get_batch*(iter: ptr rocksdb_wal_iterator_t; seq: ptr uint64): ptr rocksdb_writebatch_t {. - cdecl, importc: "rocksdb_wal_iter_get_batch", dynlib: librocksdb.} -proc rocksdb_get_latest_sequence_number*(db: ptr rocksdb_t): uint64 {.cdecl, - importc: "rocksdb_get_latest_sequence_number", dynlib: librocksdb.} -proc rocksdb_wal_iter_destroy*(iter: ptr rocksdb_wal_iterator_t) {.cdecl, - importc: "rocksdb_wal_iter_destroy", dynlib: librocksdb.} +proc rocksdb_iter_destroy*( + a1: ptr rocksdb_iterator_t +) {.cdecl, importc: "rocksdb_iter_destroy", dynlib: librocksdb.} + +proc rocksdb_iter_valid*( + a1: ptr rocksdb_iterator_t +): uint8 {.cdecl, importc: "rocksdb_iter_valid", dynlib: librocksdb.} + +proc rocksdb_iter_seek_to_first*( + a1: ptr rocksdb_iterator_t +) {.cdecl, importc: "rocksdb_iter_seek_to_first", dynlib: librocksdb.} + +proc rocksdb_iter_seek_to_last*( + a1: ptr rocksdb_iterator_t +) {.cdecl, importc: "rocksdb_iter_seek_to_last", dynlib: librocksdb.} + +proc rocksdb_iter_seek*( + a1: ptr rocksdb_iterator_t, k: cstring, klen: csize_t +) {.cdecl, importc: "rocksdb_iter_seek", dynlib: librocksdb.} + +proc rocksdb_iter_seek_for_prev*( + a1: ptr rocksdb_iterator_t, k: cstring, klen: csize_t +) {.cdecl, importc: "rocksdb_iter_seek_for_prev", dynlib: librocksdb.} + +proc rocksdb_iter_next*( + a1: ptr rocksdb_iterator_t +) {.cdecl, importc: "rocksdb_iter_next", dynlib: librocksdb.} + +proc rocksdb_iter_prev*( + a1: ptr rocksdb_iterator_t +) {.cdecl, importc: "rocksdb_iter_prev", dynlib: librocksdb.} + +proc rocksdb_iter_key*( + a1: ptr rocksdb_iterator_t, klen: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_iter_key", dynlib: librocksdb.} + +proc rocksdb_iter_value*( + a1: ptr rocksdb_iterator_t, vlen: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_iter_value", dynlib: librocksdb.} + +proc rocksdb_iter_timestamp*( + a1: ptr rocksdb_iterator_t, tslen: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_iter_timestamp", dynlib: librocksdb.} + +proc rocksdb_iter_get_error*( + a1: ptr rocksdb_iterator_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_iter_get_error", dynlib: librocksdb.} + +proc rocksdb_wal_iter_next*( + iter: ptr rocksdb_wal_iterator_t +) {.cdecl, importc: "rocksdb_wal_iter_next", dynlib: librocksdb.} + +proc rocksdb_wal_iter_valid*( + a1: ptr rocksdb_wal_iterator_t +): uint8 {.cdecl, importc: "rocksdb_wal_iter_valid", dynlib: librocksdb.} + +proc rocksdb_wal_iter_status*( + iter: ptr rocksdb_wal_iterator_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_wal_iter_status", dynlib: librocksdb.} + +proc rocksdb_wal_iter_get_batch*( + iter: ptr rocksdb_wal_iterator_t, seq: ptr uint64 +): ptr rocksdb_writebatch_t {. + cdecl, importc: "rocksdb_wal_iter_get_batch", dynlib: librocksdb +.} + +proc rocksdb_get_latest_sequence_number*( + db: ptr rocksdb_t +): uint64 {.cdecl, importc: "rocksdb_get_latest_sequence_number", dynlib: librocksdb.} + +proc rocksdb_wal_iter_destroy*( + iter: ptr rocksdb_wal_iterator_t +) {.cdecl, importc: "rocksdb_wal_iter_destroy", dynlib: librocksdb.} + ## Write batch -proc rocksdb_writebatch_create*(): ptr rocksdb_writebatch_t {.cdecl, - importc: "rocksdb_writebatch_create", dynlib: librocksdb.} -proc rocksdb_writebatch_create_from*(rep: cstring; size: csize_t): ptr rocksdb_writebatch_t {. - cdecl, importc: "rocksdb_writebatch_create_from", dynlib: librocksdb.} -proc rocksdb_writebatch_destroy*(a1: ptr rocksdb_writebatch_t) {.cdecl, - importc: "rocksdb_writebatch_destroy", dynlib: librocksdb.} -proc rocksdb_writebatch_clear*(a1: ptr rocksdb_writebatch_t) {.cdecl, - importc: "rocksdb_writebatch_clear", dynlib: librocksdb.} -proc rocksdb_writebatch_count*(a1: ptr rocksdb_writebatch_t): cint {.cdecl, - importc: "rocksdb_writebatch_count", dynlib: librocksdb.} -proc rocksdb_writebatch_put*(a1: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_put", dynlib: librocksdb.} -proc rocksdb_writebatch_put_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_put_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_put_cf_with_ts*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; ts: cstring; - tslen: csize_t; val: cstring; vlen: csize_t) {. - cdecl, importc: "rocksdb_writebatch_put_cf_with_ts", dynlib: librocksdb.} -proc rocksdb_writebatch_putv*(b: ptr rocksdb_writebatch_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_putv", dynlib: librocksdb.} -proc rocksdb_writebatch_putv_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_putv_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_merge*(a1: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_merge", dynlib: librocksdb.} -proc rocksdb_writebatch_merge_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_merge_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_mergev*(b: ptr rocksdb_writebatch_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_mergev", dynlib: librocksdb.} -proc rocksdb_writebatch_mergev_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_mergev_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_delete*(a1: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_delete", dynlib: librocksdb.} -proc rocksdb_writebatch_singledelete*(b: ptr rocksdb_writebatch_t; key: cstring; - klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_singledelete", dynlib: librocksdb.} -proc rocksdb_writebatch_delete_cf*(a1: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_delete_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_delete_cf_with_ts*(a1: ptr rocksdb_writebatch_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - ts: cstring; tslen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_delete_cf_with_ts", - dynlib: librocksdb.} -proc rocksdb_writebatch_singledelete_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_singledelete_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_singledelete_cf_with_ts*(b: ptr rocksdb_writebatch_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - ts: cstring; tslen: csize_t) {.cdecl, importc: "rocksdb_writebatch_singledelete_cf_with_ts", - dynlib: librocksdb.} -proc rocksdb_writebatch_deletev*(b: ptr rocksdb_writebatch_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_deletev", dynlib: librocksdb.} -proc rocksdb_writebatch_deletev_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_deletev_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_delete_range*(b: ptr rocksdb_writebatch_t; - start_key: cstring; start_key_len: csize_t; - end_key: cstring; end_key_len: csize_t) {. - cdecl, importc: "rocksdb_writebatch_delete_range", dynlib: librocksdb.} -proc rocksdb_writebatch_delete_range_cf*(b: ptr rocksdb_writebatch_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; - start_key_len: csize_t; end_key: cstring; - end_key_len: csize_t) {.cdecl, - importc: "rocksdb_writebatch_delete_range_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_delete_rangev*(b: ptr rocksdb_writebatch_t; num_keys: cint; - start_keys_list: cstringArray; - start_keys_list_sizes: ptr csize_t; - end_keys_list: cstringArray; - end_keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_delete_rangev", dynlib: librocksdb.} -proc rocksdb_writebatch_delete_rangev_cf*(b: ptr rocksdb_writebatch_t; - column_family: ptr rocksdb_column_family_handle_t; num_keys: cint; - start_keys_list: cstringArray; start_keys_list_sizes: ptr csize_t; - end_keys_list: cstringArray; end_keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_delete_rangev_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_put_log_data*(a1: ptr rocksdb_writebatch_t; blob: cstring; - len: csize_t) {.cdecl, - importc: "rocksdb_writebatch_put_log_data", dynlib: librocksdb.} -proc rocksdb_writebatch_iterate*(a1: ptr rocksdb_writebatch_t; state: pointer; put: proc ( - a1: pointer; k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}; deleted: proc ( - a1: pointer; k: cstring; klen: csize_t) {.cdecl.}) {.cdecl, - importc: "rocksdb_writebatch_iterate", dynlib: librocksdb.} -proc rocksdb_writebatch_data*(a1: ptr rocksdb_writebatch_t; size: ptr csize_t): cstring {. - cdecl, importc: "rocksdb_writebatch_data", dynlib: librocksdb.} -proc rocksdb_writebatch_set_save_point*(a1: ptr rocksdb_writebatch_t) {.cdecl, - importc: "rocksdb_writebatch_set_save_point", dynlib: librocksdb.} -proc rocksdb_writebatch_rollback_to_save_point*(a1: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_writebatch_rollback_to_save_point", - dynlib: librocksdb.} -proc rocksdb_writebatch_pop_save_point*(a1: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_writebatch_pop_save_point", dynlib: librocksdb.} +proc rocksdb_writebatch_create*(): ptr rocksdb_writebatch_t {. + cdecl, importc: "rocksdb_writebatch_create", dynlib: librocksdb +.} + +proc rocksdb_writebatch_create_from*( + rep: cstring, size: csize_t +): ptr rocksdb_writebatch_t {. + cdecl, importc: "rocksdb_writebatch_create_from", dynlib: librocksdb +.} + +proc rocksdb_writebatch_destroy*( + a1: ptr rocksdb_writebatch_t +) {.cdecl, importc: "rocksdb_writebatch_destroy", dynlib: librocksdb.} + +proc rocksdb_writebatch_clear*( + a1: ptr rocksdb_writebatch_t +) {.cdecl, importc: "rocksdb_writebatch_clear", dynlib: librocksdb.} + +proc rocksdb_writebatch_count*( + a1: ptr rocksdb_writebatch_t +): cint {.cdecl, importc: "rocksdb_writebatch_count", dynlib: librocksdb.} + +proc rocksdb_writebatch_put*( + a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t, val: cstring, vlen: csize_t +) {.cdecl, importc: "rocksdb_writebatch_put", dynlib: librocksdb.} + +proc rocksdb_writebatch_put_cf*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_put_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_put_cf_with_ts*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_put_cf_with_ts", dynlib: librocksdb.} + +proc rocksdb_writebatch_putv*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_putv", dynlib: librocksdb.} + +proc rocksdb_writebatch_putv_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_putv_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_merge*( + a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t, val: cstring, vlen: csize_t +) {.cdecl, importc: "rocksdb_writebatch_merge", dynlib: librocksdb.} + +proc rocksdb_writebatch_merge_cf*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_merge_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_mergev*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_mergev", dynlib: librocksdb.} + +proc rocksdb_writebatch_mergev_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_mergev_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete*( + a1: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t +) {.cdecl, importc: "rocksdb_writebatch_delete", dynlib: librocksdb.} + +proc rocksdb_writebatch_singledelete*( + b: ptr rocksdb_writebatch_t, key: cstring, klen: csize_t +) {.cdecl, importc: "rocksdb_writebatch_singledelete", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete_cf*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_delete_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete_cf_with_ts*( + a1: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + ts: cstring, + tslen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_delete_cf_with_ts", dynlib: librocksdb.} + +proc rocksdb_writebatch_singledelete_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_singledelete_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_singledelete_cf_with_ts*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + ts: cstring, + tslen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_singledelete_cf_with_ts", dynlib: librocksdb.} + +proc rocksdb_writebatch_deletev*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_deletev", dynlib: librocksdb.} + +proc rocksdb_writebatch_deletev_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_deletev_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete_range*( + b: ptr rocksdb_writebatch_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_delete_range", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete_range_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_delete_range_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete_rangev*( + b: ptr rocksdb_writebatch_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_delete_rangev", dynlib: librocksdb.} + +proc rocksdb_writebatch_delete_rangev_cf*( + b: ptr rocksdb_writebatch_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_delete_rangev_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_put_log_data*( + a1: ptr rocksdb_writebatch_t, blob: cstring, len: csize_t +) {.cdecl, importc: "rocksdb_writebatch_put_log_data", dynlib: librocksdb.} + +proc rocksdb_writebatch_iterate*( + a1: ptr rocksdb_writebatch_t, + state: pointer, + put: proc(a1: pointer, k: cstring, klen: csize_t, v: cstring, vlen: csize_t) {.cdecl.}, + deleted: proc(a1: pointer, k: cstring, klen: csize_t) {.cdecl.}, +) {.cdecl, importc: "rocksdb_writebatch_iterate", dynlib: librocksdb.} + +proc rocksdb_writebatch_data*( + a1: ptr rocksdb_writebatch_t, size: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_writebatch_data", dynlib: librocksdb.} + +proc rocksdb_writebatch_set_save_point*( + a1: ptr rocksdb_writebatch_t +) {.cdecl, importc: "rocksdb_writebatch_set_save_point", dynlib: librocksdb.} + +proc rocksdb_writebatch_rollback_to_save_point*( + a1: ptr rocksdb_writebatch_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_writebatch_rollback_to_save_point", dynlib: librocksdb.} + +proc rocksdb_writebatch_pop_save_point*( + a1: ptr rocksdb_writebatch_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_writebatch_pop_save_point", dynlib: librocksdb.} + ## Write batch with index -proc rocksdb_writebatch_wi_create*(reserved_bytes: csize_t; overwrite_keys: uint8): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_writebatch_wi_create", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_create_from*(rep: cstring; size: csize_t): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_writebatch_wi_create_from", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_destroy*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl, - importc: "rocksdb_writebatch_wi_destroy", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_clear*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl, - importc: "rocksdb_writebatch_wi_clear", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_count*(b: ptr rocksdb_writebatch_wi_t): cint {.cdecl, - importc: "rocksdb_writebatch_wi_count", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_put*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_put", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_put_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_put_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_putv*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_putv", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_putv_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_putv_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_merge*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_merge", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_merge_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_merge_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_mergev*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; num_values: cint; - values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_mergev", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_mergev_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - num_values: cint; values_list: cstringArray; - values_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_mergev_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_delete*(a1: ptr rocksdb_writebatch_wi_t; key: cstring; - klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_delete", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_singledelete*(a1: ptr rocksdb_writebatch_wi_t; - key: cstring; klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_singledelete", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_delete_cf*(a1: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_delete_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_singledelete_cf*(a1: ptr rocksdb_writebatch_wi_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t) {. - cdecl, importc: "rocksdb_writebatch_wi_singledelete_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_deletev*(b: ptr rocksdb_writebatch_wi_t; num_keys: cint; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_deletev", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_deletev_cf*(b: ptr rocksdb_writebatch_wi_t; column_family: ptr rocksdb_column_family_handle_t; - num_keys: cint; keys_list: cstringArray; - keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_deletev_cf", dynlib: librocksdb.} +proc rocksdb_writebatch_wi_create*( + reserved_bytes: csize_t, overwrite_keys: uint8 +): ptr rocksdb_writebatch_wi_t {. + cdecl, importc: "rocksdb_writebatch_wi_create", dynlib: librocksdb +.} + +proc rocksdb_writebatch_wi_create_from*( + rep: cstring, size: csize_t +): ptr rocksdb_writebatch_wi_t {. + cdecl, importc: "rocksdb_writebatch_wi_create_from", dynlib: librocksdb +.} + +proc rocksdb_writebatch_wi_destroy*( + a1: ptr rocksdb_writebatch_wi_t +) {.cdecl, importc: "rocksdb_writebatch_wi_destroy", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_clear*( + a1: ptr rocksdb_writebatch_wi_t +) {.cdecl, importc: "rocksdb_writebatch_wi_clear", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_count*( + b: ptr rocksdb_writebatch_wi_t +): cint {.cdecl, importc: "rocksdb_writebatch_wi_count", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_put*( + a1: ptr rocksdb_writebatch_wi_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_put", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_put_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_put_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_putv*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_putv", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_putv_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_putv_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_merge*( + a1: ptr rocksdb_writebatch_wi_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_merge", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_merge_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_merge_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_mergev*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_mergev", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_mergev_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + num_values: cint, + values_list: cstringArray, + values_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_mergev_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_delete*( + a1: ptr rocksdb_writebatch_wi_t, key: cstring, klen: csize_t +) {.cdecl, importc: "rocksdb_writebatch_wi_delete", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_singledelete*( + a1: ptr rocksdb_writebatch_wi_t, key: cstring, klen: csize_t +) {.cdecl, importc: "rocksdb_writebatch_wi_singledelete", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_delete_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_delete_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_singledelete_cf*( + a1: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_singledelete_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_deletev*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_deletev", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_deletev_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_deletev_cf", dynlib: librocksdb.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_range is not yet supported -proc rocksdb_writebatch_wi_delete_range*(b: ptr rocksdb_writebatch_wi_t; - start_key: cstring; - start_key_len: csize_t; end_key: cstring; - end_key_len: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_delete_range", dynlib: librocksdb.} +proc rocksdb_writebatch_wi_delete_range*( + b: ptr rocksdb_writebatch_wi_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_delete_range", dynlib: librocksdb.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_range_cf is not yet supported -proc rocksdb_writebatch_wi_delete_range_cf*(b: ptr rocksdb_writebatch_wi_t; - column_family: ptr rocksdb_column_family_handle_t; start_key: cstring; - start_key_len: csize_t; end_key: cstring; end_key_len: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_delete_range_cf", dynlib: librocksdb.} +proc rocksdb_writebatch_wi_delete_range_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + end_key: cstring, + end_key_len: csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_delete_range_cf", dynlib: librocksdb.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_rangev is not yet supported -proc rocksdb_writebatch_wi_delete_rangev*(b: ptr rocksdb_writebatch_wi_t; - num_keys: cint; start_keys_list: cstringArray; - start_keys_list_sizes: ptr csize_t; end_keys_list: cstringArray; - end_keys_list_sizes: ptr csize_t) {.cdecl, importc: "rocksdb_writebatch_wi_delete_rangev", - dynlib: librocksdb.} +proc rocksdb_writebatch_wi_delete_rangev*( + b: ptr rocksdb_writebatch_wi_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_delete_rangev", dynlib: librocksdb.} + ## DO NOT USE - rocksdb_writebatch_wi_delete_rangev_cf is not yet supported -proc rocksdb_writebatch_wi_delete_rangev_cf*(b: ptr rocksdb_writebatch_wi_t; - column_family: ptr rocksdb_column_family_handle_t; num_keys: cint; - start_keys_list: cstringArray; start_keys_list_sizes: ptr csize_t; - end_keys_list: cstringArray; end_keys_list_sizes: ptr csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_delete_rangev_cf", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_put_log_data*(a1: ptr rocksdb_writebatch_wi_t; - blob: cstring; len: csize_t) {.cdecl, - importc: "rocksdb_writebatch_wi_put_log_data", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_iterate*(b: ptr rocksdb_writebatch_wi_t; state: pointer; - put: proc (a1: pointer; k: cstring; klen: csize_t; v: cstring; vlen: csize_t) {.cdecl.}; - deleted: proc (a1: pointer; k: cstring; klen: csize_t) {.cdecl.}) {.cdecl, - importc: "rocksdb_writebatch_wi_iterate", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_data*(b: ptr rocksdb_writebatch_wi_t; size: ptr csize_t): cstring {. - cdecl, importc: "rocksdb_writebatch_wi_data", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_set_save_point*(a1: ptr rocksdb_writebatch_wi_t) {.cdecl, - importc: "rocksdb_writebatch_wi_set_save_point", dynlib: librocksdb.} +proc rocksdb_writebatch_wi_delete_rangev_cf*( + b: ptr rocksdb_writebatch_wi_t, + column_family: ptr rocksdb_column_family_handle_t, + num_keys: cint, + start_keys_list: cstringArray, + start_keys_list_sizes: ptr csize_t, + end_keys_list: cstringArray, + end_keys_list_sizes: ptr csize_t, +) {.cdecl, importc: "rocksdb_writebatch_wi_delete_rangev_cf", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_put_log_data*( + a1: ptr rocksdb_writebatch_wi_t, blob: cstring, len: csize_t +) {.cdecl, importc: "rocksdb_writebatch_wi_put_log_data", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_iterate*( + b: ptr rocksdb_writebatch_wi_t, + state: pointer, + put: proc(a1: pointer, k: cstring, klen: csize_t, v: cstring, vlen: csize_t) {.cdecl.}, + deleted: proc(a1: pointer, k: cstring, klen: csize_t) {.cdecl.}, +) {.cdecl, importc: "rocksdb_writebatch_wi_iterate", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_data*( + b: ptr rocksdb_writebatch_wi_t, size: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_writebatch_wi_data", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_set_save_point*( + a1: ptr rocksdb_writebatch_wi_t +) {.cdecl, importc: "rocksdb_writebatch_wi_set_save_point", dynlib: librocksdb.} + proc rocksdb_writebatch_wi_rollback_to_save_point*( - a1: ptr rocksdb_writebatch_wi_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_writebatch_wi_rollback_to_save_point", dynlib: librocksdb.} -proc rocksdb_writebatch_wi_get_from_batch*(wbwi: ptr rocksdb_writebatch_wi_t; - options: ptr rocksdb_options_t; key: cstring; keylen: csize_t; vallen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl, importc: "rocksdb_writebatch_wi_get_from_batch", - dynlib: librocksdb.} -proc rocksdb_writebatch_wi_get_from_batch_cf*(wbwi: ptr rocksdb_writebatch_wi_t; - options: ptr rocksdb_options_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_writebatch_wi_get_from_batch_cf", dynlib: librocksdb.} + a1: ptr rocksdb_writebatch_wi_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_writebatch_wi_rollback_to_save_point", dynlib: librocksdb.} + +proc rocksdb_writebatch_wi_get_from_batch*( + wbwi: ptr rocksdb_writebatch_wi_t, + options: ptr rocksdb_options_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {. + cdecl, importc: "rocksdb_writebatch_wi_get_from_batch", dynlib: librocksdb +.} + +proc rocksdb_writebatch_wi_get_from_batch_cf*( + wbwi: ptr rocksdb_writebatch_wi_t, + options: ptr rocksdb_options_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {. + cdecl, importc: "rocksdb_writebatch_wi_get_from_batch_cf", dynlib: librocksdb +.} + proc rocksdb_writebatch_wi_get_from_batch_and_db*( - wbwi: ptr rocksdb_writebatch_wi_t; db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_writebatch_wi_get_from_batch_and_db", dynlib: librocksdb.} + wbwi: ptr rocksdb_writebatch_wi_t, + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {. + cdecl, importc: "rocksdb_writebatch_wi_get_from_batch_and_db", dynlib: librocksdb +.} + proc rocksdb_writebatch_wi_get_from_batch_and_db_cf*( - wbwi: ptr rocksdb_writebatch_wi_t; db: ptr rocksdb_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_writebatch_wi_get_from_batch_and_db_cf", dynlib: librocksdb.} -proc rocksdb_write_writebatch_wi*(db: ptr rocksdb_t; - options: ptr rocksdb_writeoptions_t; - wbwi: ptr rocksdb_writebatch_wi_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_write_writebatch_wi", dynlib: librocksdb.} + wbwi: ptr rocksdb_writebatch_wi_t, + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {. + cdecl, importc: "rocksdb_writebatch_wi_get_from_batch_and_db_cf", dynlib: librocksdb +.} + +proc rocksdb_write_writebatch_wi*( + db: ptr rocksdb_t, + options: ptr rocksdb_writeoptions_t, + wbwi: ptr rocksdb_writebatch_wi_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_write_writebatch_wi", dynlib: librocksdb.} + proc rocksdb_writebatch_wi_create_iterator_with_base*( - wbwi: ptr rocksdb_writebatch_wi_t; base_iterator: ptr rocksdb_iterator_t): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_writebatch_wi_create_iterator_with_base", - dynlib: librocksdb.} + wbwi: ptr rocksdb_writebatch_wi_t, base_iterator: ptr rocksdb_iterator_t +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_writebatch_wi_create_iterator_with_base", dynlib: librocksdb +.} + proc rocksdb_writebatch_wi_create_iterator_with_base_cf*( - wbwi: ptr rocksdb_writebatch_wi_t; base_iterator: ptr rocksdb_iterator_t; - cf: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {.cdecl, - importc: "rocksdb_writebatch_wi_create_iterator_with_base_cf", - dynlib: librocksdb.} + wbwi: ptr rocksdb_writebatch_wi_t, + base_iterator: ptr rocksdb_iterator_t, + cf: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {. + cdecl, + importc: "rocksdb_writebatch_wi_create_iterator_with_base_cf", + dynlib: librocksdb +.} + ## Options utils ## Load the latest rocksdb options from the specified db_path. ## @@ -907,85 +1638,139 @@ proc rocksdb_writebatch_wi_create_iterator_with_base_cf*( ## returned. db_options, column_family_names, and column_family_options ## will be set to NULL. -proc rocksdb_load_latest_options*(db_path: cstring; env: ptr rocksdb_env_t; - ignore_unknown_options: bool; - cache: ptr rocksdb_cache_t; - db_options: ptr ptr rocksdb_options_t; - num_column_families: ptr csize_t; - column_family_names: ptr cstringArray; - column_family_options: ptr ptr ptr rocksdb_options_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_load_latest_options", dynlib: librocksdb.} -proc rocksdb_load_latest_options_destroy*(db_options: ptr rocksdb_options_t; - list_column_family_names: cstringArray; - list_column_family_options: ptr ptr rocksdb_options_t; len: csize_t) {.cdecl, - importc: "rocksdb_load_latest_options_destroy", dynlib: librocksdb.} +proc rocksdb_load_latest_options*( + db_path: cstring, + env: ptr rocksdb_env_t, + ignore_unknown_options: bool, + cache: ptr rocksdb_cache_t, + db_options: ptr ptr rocksdb_options_t, + num_column_families: ptr csize_t, + column_family_names: ptr cstringArray, + column_family_options: ptr ptr ptr rocksdb_options_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_load_latest_options", dynlib: librocksdb.} + +proc rocksdb_load_latest_options_destroy*( + db_options: ptr rocksdb_options_t, + list_column_family_names: cstringArray, + list_column_family_options: ptr ptr rocksdb_options_t, + len: csize_t, +) {.cdecl, importc: "rocksdb_load_latest_options_destroy", dynlib: librocksdb.} + ## Block based table options proc rocksdb_block_based_options_create*(): ptr rocksdb_block_based_table_options_t {. - cdecl, importc: "rocksdb_block_based_options_create", dynlib: librocksdb.} + cdecl, importc: "rocksdb_block_based_options_create", dynlib: librocksdb +.} + proc rocksdb_block_based_options_destroy*( - options: ptr rocksdb_block_based_table_options_t) {.cdecl, - importc: "rocksdb_block_based_options_destroy", dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t +) {.cdecl, importc: "rocksdb_block_based_options_destroy", dynlib: librocksdb.} + proc rocksdb_block_based_options_set_checksum*( - a1: ptr rocksdb_block_based_table_options_t; a2: char) {.cdecl, - importc: "rocksdb_block_based_options_set_checksum", dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: char +) {.cdecl, importc: "rocksdb_block_based_options_set_checksum", dynlib: librocksdb.} + proc rocksdb_block_based_options_set_block_size*( - options: ptr rocksdb_block_based_table_options_t; block_size: csize_t) {.cdecl, - importc: "rocksdb_block_based_options_set_block_size", dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, block_size: csize_t +) {.cdecl, importc: "rocksdb_block_based_options_set_block_size", dynlib: librocksdb.} + proc rocksdb_block_based_options_set_block_size_deviation*( - options: ptr rocksdb_block_based_table_options_t; block_size_deviation: cint) {. - cdecl, importc: "rocksdb_block_based_options_set_block_size_deviation", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, block_size_deviation: cint +) {. + cdecl, + importc: "rocksdb_block_based_options_set_block_size_deviation", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_block_restart_interval*( - options: ptr rocksdb_block_based_table_options_t; block_restart_interval: cint) {. - cdecl, importc: "rocksdb_block_based_options_set_block_restart_interval", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, block_restart_interval: cint +) {. + cdecl, + importc: "rocksdb_block_based_options_set_block_restart_interval", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_index_block_restart_interval*( - options: ptr rocksdb_block_based_table_options_t; - index_block_restart_interval: cint) {.cdecl, importc: "rocksdb_block_based_options_set_index_block_restart_interval", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, index_block_restart_interval: cint +) {. + cdecl, + importc: "rocksdb_block_based_options_set_index_block_restart_interval", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_metadata_block_size*( - options: ptr rocksdb_block_based_table_options_t; metadata_block_size: uint64) {. - cdecl, importc: "rocksdb_block_based_options_set_metadata_block_size", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, metadata_block_size: uint64 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_metadata_block_size", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_partition_filters*( - options: ptr rocksdb_block_based_table_options_t; partition_filters: uint8) {. - cdecl, importc: "rocksdb_block_based_options_set_partition_filters", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, partition_filters: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_partition_filters", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_optimize_filters_for_memory*( - options: ptr rocksdb_block_based_table_options_t; - optimize_filters_for_memory: uint8) {.cdecl, importc: "rocksdb_block_based_options_set_optimize_filters_for_memory", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, optimize_filters_for_memory: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_optimize_filters_for_memory", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_use_delta_encoding*( - options: ptr rocksdb_block_based_table_options_t; use_delta_encoding: uint8) {. - cdecl, importc: "rocksdb_block_based_options_set_use_delta_encoding", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, use_delta_encoding: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_use_delta_encoding", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_filter_policy*( - options: ptr rocksdb_block_based_table_options_t; - filter_policy: ptr rocksdb_filterpolicy_t) {.cdecl, - importc: "rocksdb_block_based_options_set_filter_policy", dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, + filter_policy: ptr rocksdb_filterpolicy_t, +) {. + cdecl, importc: "rocksdb_block_based_options_set_filter_policy", dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_no_block_cache*( - options: ptr rocksdb_block_based_table_options_t; no_block_cache: uint8) {.cdecl, - importc: "rocksdb_block_based_options_set_no_block_cache", dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, no_block_cache: uint8 +) {. + cdecl, importc: "rocksdb_block_based_options_set_no_block_cache", dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_block_cache*( - options: ptr rocksdb_block_based_table_options_t; - block_cache: ptr rocksdb_cache_t) {.cdecl, importc: "rocksdb_block_based_options_set_block_cache", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, block_cache: ptr rocksdb_cache_t +) {.cdecl, importc: "rocksdb_block_based_options_set_block_cache", dynlib: librocksdb.} + proc rocksdb_block_based_options_set_whole_key_filtering*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl, - importc: "rocksdb_block_based_options_set_whole_key_filtering", - dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_whole_key_filtering", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_format_version*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl, - importc: "rocksdb_block_based_options_set_format_version", dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {. + cdecl, importc: "rocksdb_block_based_options_set_format_version", dynlib: librocksdb +.} + const rocksdb_block_based_table_index_type_binary_search* = 0 rocksdb_block_based_table_index_type_hash_search* = 1 rocksdb_block_based_table_index_type_two_level_index_search* = 2 proc rocksdb_block_based_options_set_index_type*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl, - importc: "rocksdb_block_based_options_set_index_type", dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {.cdecl, importc: "rocksdb_block_based_options_set_index_type", dynlib: librocksdb.} + ## uses one of the above enums const @@ -993,300 +1778,597 @@ const rocksdb_block_based_table_data_block_index_type_binary_search_and_hash* = 1 proc rocksdb_block_based_options_set_data_block_index_type*( - a1: ptr rocksdb_block_based_table_options_t; a2: cint) {.cdecl, - importc: "rocksdb_block_based_options_set_data_block_index_type", - dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_block_based_options_set_data_block_index_type", + dynlib: librocksdb +.} + ## uses one of the above enums proc rocksdb_block_based_options_set_data_block_hash_ratio*( - options: ptr rocksdb_block_based_table_options_t; v: cdouble) {.cdecl, - importc: "rocksdb_block_based_options_set_data_block_hash_ratio", - dynlib: librocksdb.} + options: ptr rocksdb_block_based_table_options_t, v: cdouble +) {. + cdecl, + importc: "rocksdb_block_based_options_set_data_block_hash_ratio", + dynlib: librocksdb +.} + ## rocksdb_block_based_options_set_hash_index_allow_collision() ## is removed since BlockBasedTableOptions.hash_index_allow_collision() ## is removed proc rocksdb_block_based_options_set_cache_index_and_filter_blocks*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl, - importc: "rocksdb_block_based_options_set_cache_index_and_filter_blocks", - dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_cache_index_and_filter_blocks", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl, importc: "rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority", - dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {. + cdecl, + importc: + "rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl, importc: "rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache", - dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache", + dynlib: librocksdb +.} + proc rocksdb_block_based_options_set_pin_top_level_index_and_filter*( - a1: ptr rocksdb_block_based_table_options_t; a2: uint8) {.cdecl, - importc: "rocksdb_block_based_options_set_pin_top_level_index_and_filter", - dynlib: librocksdb.} -proc rocksdb_options_set_block_based_table_factory*(opt: ptr rocksdb_options_t; - table_options: ptr rocksdb_block_based_table_options_t) {.cdecl, - importc: "rocksdb_options_set_block_based_table_factory", dynlib: librocksdb.} -proc rocksdb_options_set_write_buffer_manager*(opt: ptr rocksdb_options_t; - wbm: ptr rocksdb_write_buffer_manager_t) {.cdecl, - importc: "rocksdb_options_set_write_buffer_manager", dynlib: librocksdb.} + a1: ptr rocksdb_block_based_table_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_block_based_options_set_pin_top_level_index_and_filter", + dynlib: librocksdb +.} + +proc rocksdb_options_set_block_based_table_factory*( + opt: ptr rocksdb_options_t, table_options: ptr rocksdb_block_based_table_options_t +) {. + cdecl, importc: "rocksdb_options_set_block_based_table_factory", dynlib: librocksdb +.} + +proc rocksdb_options_set_write_buffer_manager*( + opt: ptr rocksdb_options_t, wbm: ptr rocksdb_write_buffer_manager_t +) {.cdecl, importc: "rocksdb_options_set_write_buffer_manager", dynlib: librocksdb.} + ## Cuckoo table options -proc rocksdb_cuckoo_options_create*(): ptr rocksdb_cuckoo_table_options_t {.cdecl, - importc: "rocksdb_cuckoo_options_create", dynlib: librocksdb.} -proc rocksdb_cuckoo_options_destroy*(options: ptr rocksdb_cuckoo_table_options_t) {. - cdecl, importc: "rocksdb_cuckoo_options_destroy", dynlib: librocksdb.} +proc rocksdb_cuckoo_options_create*(): ptr rocksdb_cuckoo_table_options_t {. + cdecl, importc: "rocksdb_cuckoo_options_create", dynlib: librocksdb +.} + +proc rocksdb_cuckoo_options_destroy*( + options: ptr rocksdb_cuckoo_table_options_t +) {.cdecl, importc: "rocksdb_cuckoo_options_destroy", dynlib: librocksdb.} + proc rocksdb_cuckoo_options_set_hash_ratio*( - options: ptr rocksdb_cuckoo_table_options_t; v: cdouble) {.cdecl, - importc: "rocksdb_cuckoo_options_set_hash_ratio", dynlib: librocksdb.} + options: ptr rocksdb_cuckoo_table_options_t, v: cdouble +) {.cdecl, importc: "rocksdb_cuckoo_options_set_hash_ratio", dynlib: librocksdb.} + proc rocksdb_cuckoo_options_set_max_search_depth*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint32) {.cdecl, - importc: "rocksdb_cuckoo_options_set_max_search_depth", dynlib: librocksdb.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint32 +) {.cdecl, importc: "rocksdb_cuckoo_options_set_max_search_depth", dynlib: librocksdb.} + proc rocksdb_cuckoo_options_set_cuckoo_block_size*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint32) {.cdecl, - importc: "rocksdb_cuckoo_options_set_cuckoo_block_size", dynlib: librocksdb.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint32 +) {.cdecl, importc: "rocksdb_cuckoo_options_set_cuckoo_block_size", dynlib: librocksdb.} + proc rocksdb_cuckoo_options_set_identity_as_first_hash*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint8) {.cdecl, - importc: "rocksdb_cuckoo_options_set_identity_as_first_hash", - dynlib: librocksdb.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint8 +) {. + cdecl, + importc: "rocksdb_cuckoo_options_set_identity_as_first_hash", + dynlib: librocksdb +.} + proc rocksdb_cuckoo_options_set_use_module_hash*( - options: ptr rocksdb_cuckoo_table_options_t; v: uint8) {.cdecl, - importc: "rocksdb_cuckoo_options_set_use_module_hash", dynlib: librocksdb.} -proc rocksdb_options_set_cuckoo_table_factory*(opt: ptr rocksdb_options_t; - table_options: ptr rocksdb_cuckoo_table_options_t) {.cdecl, - importc: "rocksdb_options_set_cuckoo_table_factory", dynlib: librocksdb.} + options: ptr rocksdb_cuckoo_table_options_t, v: uint8 +) {.cdecl, importc: "rocksdb_cuckoo_options_set_use_module_hash", dynlib: librocksdb.} + +proc rocksdb_options_set_cuckoo_table_factory*( + opt: ptr rocksdb_options_t, table_options: ptr rocksdb_cuckoo_table_options_t +) {.cdecl, importc: "rocksdb_options_set_cuckoo_table_factory", dynlib: librocksdb.} + ## Options -proc rocksdb_set_options*(db: ptr rocksdb_t; count: cint; keys: ptr cstring; - values: ptr cstring; errptr: cstringArray) {.cdecl, - importc: "rocksdb_set_options", dynlib: librocksdb.} -proc rocksdb_set_options_cf*(db: ptr rocksdb_t; - handle: ptr rocksdb_column_family_handle_t; - count: cint; keys: ptr cstring; values: ptr cstring; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_set_options_cf", dynlib: librocksdb.} -proc rocksdb_options_create*(): ptr rocksdb_options_t {.cdecl, - importc: "rocksdb_options_create", dynlib: librocksdb.} -proc rocksdb_options_destroy*(a1: ptr rocksdb_options_t) {.cdecl, - importc: "rocksdb_options_destroy", dynlib: librocksdb.} -proc rocksdb_options_create_copy*(a1: ptr rocksdb_options_t): ptr rocksdb_options_t {. - cdecl, importc: "rocksdb_options_create_copy", dynlib: librocksdb.} -proc rocksdb_options_increase_parallelism*(opt: ptr rocksdb_options_t; - total_threads: cint) {.cdecl, importc: "rocksdb_options_increase_parallelism", - dynlib: librocksdb.} -proc rocksdb_options_optimize_for_point_lookup*(opt: ptr rocksdb_options_t; - block_cache_size_mb: uint64) {.cdecl, importc: "rocksdb_options_optimize_for_point_lookup", - dynlib: librocksdb.} -proc rocksdb_options_optimize_level_style_compaction*(opt: ptr rocksdb_options_t; - memtable_memory_budget: uint64) {.cdecl, importc: "rocksdb_options_optimize_level_style_compaction", - dynlib: librocksdb.} +proc rocksdb_set_options*( + db: ptr rocksdb_t, + count: cint, + keys: ptr cstring, + values: ptr cstring, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_set_options", dynlib: librocksdb.} + +proc rocksdb_set_options_cf*( + db: ptr rocksdb_t, + handle: ptr rocksdb_column_family_handle_t, + count: cint, + keys: ptr cstring, + values: ptr cstring, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_set_options_cf", dynlib: librocksdb.} + +proc rocksdb_options_create*(): ptr rocksdb_options_t {. + cdecl, importc: "rocksdb_options_create", dynlib: librocksdb +.} + +proc rocksdb_options_destroy*( + a1: ptr rocksdb_options_t +) {.cdecl, importc: "rocksdb_options_destroy", dynlib: librocksdb.} + +proc rocksdb_options_create_copy*( + a1: ptr rocksdb_options_t +): ptr rocksdb_options_t {. + cdecl, importc: "rocksdb_options_create_copy", dynlib: librocksdb +.} + +proc rocksdb_options_increase_parallelism*( + opt: ptr rocksdb_options_t, total_threads: cint +) {.cdecl, importc: "rocksdb_options_increase_parallelism", dynlib: librocksdb.} + +proc rocksdb_options_optimize_for_point_lookup*( + opt: ptr rocksdb_options_t, block_cache_size_mb: uint64 +) {.cdecl, importc: "rocksdb_options_optimize_for_point_lookup", dynlib: librocksdb.} + +proc rocksdb_options_optimize_level_style_compaction*( + opt: ptr rocksdb_options_t, memtable_memory_budget: uint64 +) {. + cdecl, importc: "rocksdb_options_optimize_level_style_compaction", dynlib: librocksdb +.} + proc rocksdb_options_optimize_universal_style_compaction*( - opt: ptr rocksdb_options_t; memtable_memory_budget: uint64) {.cdecl, - importc: "rocksdb_options_optimize_universal_style_compaction", - dynlib: librocksdb.} -proc rocksdb_options_set_allow_ingest_behind*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_allow_ingest_behind", dynlib: librocksdb.} -proc rocksdb_options_get_allow_ingest_behind*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_allow_ingest_behind", dynlib: librocksdb.} -proc rocksdb_options_set_compaction_filter*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_compactionfilter_t) {.cdecl, importc: "rocksdb_options_set_compaction_filter", - dynlib: librocksdb.} -proc rocksdb_options_set_compaction_filter_factory*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_compactionfilterfactory_t) {.cdecl, - importc: "rocksdb_options_set_compaction_filter_factory", dynlib: librocksdb.} -proc rocksdb_options_compaction_readahead_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_compaction_readahead_size", - dynlib: librocksdb.} -proc rocksdb_options_get_compaction_readahead_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_compaction_readahead_size", - dynlib: librocksdb.} -proc rocksdb_options_set_comparator*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_comparator_t) {.cdecl, - importc: "rocksdb_options_set_comparator", dynlib: librocksdb.} -proc rocksdb_options_set_merge_operator*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_mergeoperator_t) {.cdecl, - importc: "rocksdb_options_set_merge_operator", dynlib: librocksdb.} -proc rocksdb_options_set_uint64add_merge_operator*(a1: ptr rocksdb_options_t) {. - cdecl, importc: "rocksdb_options_set_uint64add_merge_operator", - dynlib: librocksdb.} -proc rocksdb_options_set_compression_per_level*(opt: ptr rocksdb_options_t; - level_values: ptr cint; num_levels: csize_t) {.cdecl, - importc: "rocksdb_options_set_compression_per_level", dynlib: librocksdb.} -proc rocksdb_options_set_create_if_missing*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_create_if_missing", dynlib: librocksdb.} -proc rocksdb_options_get_create_if_missing*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_create_if_missing", dynlib: librocksdb.} + opt: ptr rocksdb_options_t, memtable_memory_budget: uint64 +) {. + cdecl, + importc: "rocksdb_options_optimize_universal_style_compaction", + dynlib: librocksdb +.} + +proc rocksdb_options_set_allow_ingest_behind*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_allow_ingest_behind", dynlib: librocksdb.} + +proc rocksdb_options_get_allow_ingest_behind*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_allow_ingest_behind", dynlib: librocksdb +.} + +proc rocksdb_options_set_compaction_filter*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_compactionfilter_t +) {.cdecl, importc: "rocksdb_options_set_compaction_filter", dynlib: librocksdb.} + +proc rocksdb_options_set_compaction_filter_factory*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_compactionfilterfactory_t +) {. + cdecl, importc: "rocksdb_options_set_compaction_filter_factory", dynlib: librocksdb +.} + +proc rocksdb_options_compaction_readahead_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_compaction_readahead_size", dynlib: librocksdb.} + +proc rocksdb_options_get_compaction_readahead_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_compaction_readahead_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_comparator*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_comparator_t +) {.cdecl, importc: "rocksdb_options_set_comparator", dynlib: librocksdb.} + +proc rocksdb_options_set_merge_operator*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_mergeoperator_t +) {.cdecl, importc: "rocksdb_options_set_merge_operator", dynlib: librocksdb.} + +proc rocksdb_options_set_uint64add_merge_operator*( + a1: ptr rocksdb_options_t +) {.cdecl, importc: "rocksdb_options_set_uint64add_merge_operator", dynlib: librocksdb.} + +proc rocksdb_options_set_compression_per_level*( + opt: ptr rocksdb_options_t, level_values: ptr cint, num_levels: csize_t +) {.cdecl, importc: "rocksdb_options_set_compression_per_level", dynlib: librocksdb.} + +proc rocksdb_options_set_create_if_missing*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_create_if_missing", dynlib: librocksdb.} + +proc rocksdb_options_get_create_if_missing*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_create_if_missing", dynlib: librocksdb.} + proc rocksdb_options_set_create_missing_column_families*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_create_missing_column_families", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_create_missing_column_families", + dynlib: librocksdb +.} + proc rocksdb_options_get_create_missing_column_families*( - a1: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_create_missing_column_families", - dynlib: librocksdb.} -proc rocksdb_options_set_error_if_exists*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_error_if_exists", dynlib: librocksdb.} -proc rocksdb_options_get_error_if_exists*(a1: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_error_if_exists", dynlib: librocksdb.} -proc rocksdb_options_set_paranoid_checks*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_paranoid_checks", dynlib: librocksdb.} -proc rocksdb_options_get_paranoid_checks*(a1: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_paranoid_checks", dynlib: librocksdb.} -proc rocksdb_options_set_db_paths*(a1: ptr rocksdb_options_t; - path_values: ptr ptr rocksdb_dbpath_t; - num_paths: csize_t) {.cdecl, - importc: "rocksdb_options_set_db_paths", dynlib: librocksdb.} -proc rocksdb_options_set_cf_paths*(a1: ptr rocksdb_options_t; - path_values: ptr ptr rocksdb_dbpath_t; - num_paths: csize_t) {.cdecl, - importc: "rocksdb_options_set_cf_paths", dynlib: librocksdb.} -proc rocksdb_options_set_env*(a1: ptr rocksdb_options_t; a2: ptr rocksdb_env_t) {. - cdecl, importc: "rocksdb_options_set_env", dynlib: librocksdb.} -proc rocksdb_options_set_info_log*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_logger_t) {.cdecl, - importc: "rocksdb_options_set_info_log", dynlib: librocksdb.} -proc rocksdb_options_get_info_log*(opt: ptr rocksdb_options_t): ptr rocksdb_logger_t {. - cdecl, importc: "rocksdb_options_get_info_log", dynlib: librocksdb.} -proc rocksdb_options_set_info_log_level*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl, - importc: "rocksdb_options_set_info_log_level", dynlib: librocksdb.} -proc rocksdb_options_get_info_log_level*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_info_log_level", dynlib: librocksdb.} -proc rocksdb_logger_create_stderr_logger*(log_level: cint; prefix: cstring): ptr rocksdb_logger_t {. - cdecl, importc: "rocksdb_logger_create_stderr_logger", dynlib: librocksdb.} -proc rocksdb_logger_destroy*(logger: ptr rocksdb_logger_t) {.cdecl, - importc: "rocksdb_logger_destroy", dynlib: librocksdb.} -proc rocksdb_options_set_write_buffer_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl, importc: "rocksdb_options_set_write_buffer_size", dynlib: librocksdb.} -proc rocksdb_options_get_write_buffer_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_write_buffer_size", dynlib: librocksdb.} -proc rocksdb_options_set_db_write_buffer_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_db_write_buffer_size", - dynlib: librocksdb.} -proc rocksdb_options_get_db_write_buffer_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_db_write_buffer_size", dynlib: librocksdb.} -proc rocksdb_options_set_max_open_files*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl, - importc: "rocksdb_options_set_max_open_files", dynlib: librocksdb.} -proc rocksdb_options_get_max_open_files*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_max_open_files", dynlib: librocksdb.} -proc rocksdb_options_set_max_file_opening_threads*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_max_file_opening_threads", - dynlib: librocksdb.} -proc rocksdb_options_get_max_file_opening_threads*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_max_file_opening_threads", - dynlib: librocksdb.} -proc rocksdb_options_set_max_total_wal_size*(opt: ptr rocksdb_options_t; n: uint64) {. - cdecl, importc: "rocksdb_options_set_max_total_wal_size", dynlib: librocksdb.} -proc rocksdb_options_get_max_total_wal_size*(opt: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_max_total_wal_size", dynlib: librocksdb.} -proc rocksdb_options_set_compression_options*(a1: ptr rocksdb_options_t; a2: cint; - a3: cint; a4: cint; a5: cint) {.cdecl, importc: "rocksdb_options_set_compression_options", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_create_missing_column_families", + dynlib: librocksdb +.} + +proc rocksdb_options_set_error_if_exists*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_error_if_exists", dynlib: librocksdb.} + +proc rocksdb_options_get_error_if_exists*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_error_if_exists", dynlib: librocksdb.} + +proc rocksdb_options_set_paranoid_checks*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_paranoid_checks", dynlib: librocksdb.} + +proc rocksdb_options_get_paranoid_checks*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_paranoid_checks", dynlib: librocksdb.} + +proc rocksdb_options_set_db_paths*( + a1: ptr rocksdb_options_t, path_values: ptr ptr rocksdb_dbpath_t, num_paths: csize_t +) {.cdecl, importc: "rocksdb_options_set_db_paths", dynlib: librocksdb.} + +proc rocksdb_options_set_cf_paths*( + a1: ptr rocksdb_options_t, path_values: ptr ptr rocksdb_dbpath_t, num_paths: csize_t +) {.cdecl, importc: "rocksdb_options_set_cf_paths", dynlib: librocksdb.} + +proc rocksdb_options_set_env*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_env_t +) {.cdecl, importc: "rocksdb_options_set_env", dynlib: librocksdb.} + +proc rocksdb_options_set_info_log*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_logger_t +) {.cdecl, importc: "rocksdb_options_set_info_log", dynlib: librocksdb.} + +proc rocksdb_options_get_info_log*( + opt: ptr rocksdb_options_t +): ptr rocksdb_logger_t {. + cdecl, importc: "rocksdb_options_get_info_log", dynlib: librocksdb +.} + +proc rocksdb_options_set_info_log_level*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_info_log_level", dynlib: librocksdb.} + +proc rocksdb_options_get_info_log_level*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_info_log_level", dynlib: librocksdb.} + +proc rocksdb_logger_create_stderr_logger*( + log_level: cint, prefix: cstring +): ptr rocksdb_logger_t {. + cdecl, importc: "rocksdb_logger_create_stderr_logger", dynlib: librocksdb +.} + +proc rocksdb_logger_destroy*( + logger: ptr rocksdb_logger_t +) {.cdecl, importc: "rocksdb_logger_destroy", dynlib: librocksdb.} + +proc rocksdb_options_set_write_buffer_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_write_buffer_size", dynlib: librocksdb.} + +proc rocksdb_options_get_write_buffer_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_write_buffer_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_db_write_buffer_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_db_write_buffer_size", dynlib: librocksdb.} + +proc rocksdb_options_get_db_write_buffer_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_db_write_buffer_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_open_files*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_max_open_files", dynlib: librocksdb.} + +proc rocksdb_options_get_max_open_files*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_max_open_files", dynlib: librocksdb.} + +proc rocksdb_options_set_max_file_opening_threads*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_max_file_opening_threads", dynlib: librocksdb.} + +proc rocksdb_options_get_max_file_opening_threads*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_max_file_opening_threads", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_total_wal_size*( + opt: ptr rocksdb_options_t, n: uint64 +) {.cdecl, importc: "rocksdb_options_set_max_total_wal_size", dynlib: librocksdb.} + +proc rocksdb_options_get_max_total_wal_size*( + opt: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_max_total_wal_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_compression_options*( + a1: ptr rocksdb_options_t, a2: cint, a3: cint, a4: cint, a5: cint +) {.cdecl, importc: "rocksdb_options_set_compression_options", dynlib: librocksdb.} + proc rocksdb_options_set_compression_options_zstd_max_train_bytes*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl, importc: "rocksdb_options_set_compression_options_zstd_max_train_bytes", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_options_set_compression_options_zstd_max_train_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_get_compression_options_zstd_max_train_bytes*( - opt: ptr rocksdb_options_t): cint {.cdecl, importc: "rocksdb_options_get_compression_options_zstd_max_train_bytes", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): cint {. + cdecl, + importc: "rocksdb_options_get_compression_options_zstd_max_train_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_set_compression_options_use_zstd_dict_trainer*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_compression_options_use_zstd_dict_trainer", + dynlib: librocksdb +.} + proc rocksdb_options_get_compression_options_use_zstd_dict_trainer*( - opt: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_compression_options_use_zstd_dict_trainer", + dynlib: librocksdb +.} + proc rocksdb_options_set_compression_options_parallel_threads*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl, importc: "rocksdb_options_set_compression_options_parallel_threads", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_options_set_compression_options_parallel_threads", + dynlib: librocksdb +.} + proc rocksdb_options_get_compression_options_parallel_threads*( - opt: ptr rocksdb_options_t): cint {.cdecl, importc: "rocksdb_options_get_compression_options_parallel_threads", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): cint {. + cdecl, + importc: "rocksdb_options_get_compression_options_parallel_threads", + dynlib: librocksdb +.} + proc rocksdb_options_set_compression_options_max_dict_buffer_bytes*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl, importc: "rocksdb_options_set_compression_options_max_dict_buffer_bytes", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint64 +) {. + cdecl, + importc: "rocksdb_options_set_compression_options_max_dict_buffer_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_get_compression_options_max_dict_buffer_bytes*( - opt: ptr rocksdb_options_t): uint64 {.cdecl, importc: "rocksdb_options_get_compression_options_max_dict_buffer_bytes", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): uint64 {. + cdecl, + importc: "rocksdb_options_get_compression_options_max_dict_buffer_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_set_bottommost_compression_options*( - a1: ptr rocksdb_options_t; a2: cint; a3: cint; a4: cint; a5: cint; a6: uint8) {.cdecl, - importc: "rocksdb_options_set_bottommost_compression_options", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint, a3: cint, a4: cint, a5: cint, a6: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_bottommost_compression_options", + dynlib: librocksdb +.} + proc rocksdb_options_set_bottommost_compression_options_zstd_max_train_bytes*( - a1: ptr rocksdb_options_t; a2: cint; a3: uint8) {.cdecl, importc: "rocksdb_options_set_bottommost_compression_options_zstd_max_train_bytes", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint, a3: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_bottommost_compression_options_zstd_max_train_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer*( - a1: ptr rocksdb_options_t; a2: uint8; a3: uint8) {.cdecl, importc: "rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8, a3: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer", + dynlib: librocksdb +.} + proc rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer*( - opt: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer", + dynlib: librocksdb +.} + proc rocksdb_options_set_bottommost_compression_options_max_dict_buffer_bytes*( - a1: ptr rocksdb_options_t; a2: uint64; a3: uint8) {.cdecl, importc: "rocksdb_options_set_bottommost_compression_options_max_dict_buffer_bytes", - dynlib: librocksdb.} -proc rocksdb_options_set_prefix_extractor*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_slicetransform_t) {.cdecl, importc: "rocksdb_options_set_prefix_extractor", - dynlib: librocksdb.} -proc rocksdb_options_set_num_levels*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl, - importc: "rocksdb_options_set_num_levels", dynlib: librocksdb.} -proc rocksdb_options_get_num_levels*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_num_levels", dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint64, a3: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_bottommost_compression_options_max_dict_buffer_bytes", + dynlib: librocksdb +.} + +proc rocksdb_options_set_prefix_extractor*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_slicetransform_t +) {.cdecl, importc: "rocksdb_options_set_prefix_extractor", dynlib: librocksdb.} + +proc rocksdb_options_set_num_levels*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_num_levels", dynlib: librocksdb.} + +proc rocksdb_options_get_num_levels*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_num_levels", dynlib: librocksdb.} + proc rocksdb_options_set_level0_file_num_compaction_trigger*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl, importc: "rocksdb_options_set_level0_file_num_compaction_trigger", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_options_set_level0_file_num_compaction_trigger", + dynlib: librocksdb +.} + proc rocksdb_options_get_level0_file_num_compaction_trigger*( - a1: ptr rocksdb_options_t): cint {.cdecl, importc: "rocksdb_options_get_level0_file_num_compaction_trigger", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cint {. + cdecl, + importc: "rocksdb_options_get_level0_file_num_compaction_trigger", + dynlib: librocksdb +.} + proc rocksdb_options_set_level0_slowdown_writes_trigger*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl, importc: "rocksdb_options_set_level0_slowdown_writes_trigger", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_options_set_level0_slowdown_writes_trigger", + dynlib: librocksdb +.} + proc rocksdb_options_get_level0_slowdown_writes_trigger*( - a1: ptr rocksdb_options_t): cint {.cdecl, importc: "rocksdb_options_get_level0_slowdown_writes_trigger", - dynlib: librocksdb.} -proc rocksdb_options_set_level0_stop_writes_trigger*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_level0_stop_writes_trigger", - dynlib: librocksdb.} -proc rocksdb_options_get_level0_stop_writes_trigger*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_level0_stop_writes_trigger", - dynlib: librocksdb.} -proc rocksdb_options_set_target_file_size_base*(a1: ptr rocksdb_options_t; - a2: uint64) {.cdecl, importc: "rocksdb_options_set_target_file_size_base", - dynlib: librocksdb.} -proc rocksdb_options_get_target_file_size_base*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_target_file_size_base", dynlib: librocksdb.} -proc rocksdb_options_set_target_file_size_multiplier*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_target_file_size_multiplier", - dynlib: librocksdb.} -proc rocksdb_options_get_target_file_size_multiplier*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_target_file_size_multiplier", - dynlib: librocksdb.} -proc rocksdb_options_set_max_bytes_for_level_base*(a1: ptr rocksdb_options_t; - a2: uint64) {.cdecl, importc: "rocksdb_options_set_max_bytes_for_level_base", - dynlib: librocksdb.} -proc rocksdb_options_get_max_bytes_for_level_base*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_max_bytes_for_level_base", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cint {. + cdecl, + importc: "rocksdb_options_get_level0_slowdown_writes_trigger", + dynlib: librocksdb +.} + +proc rocksdb_options_set_level0_stop_writes_trigger*( + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, importc: "rocksdb_options_set_level0_stop_writes_trigger", dynlib: librocksdb +.} + +proc rocksdb_options_get_level0_stop_writes_trigger*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_level0_stop_writes_trigger", dynlib: librocksdb +.} + +proc rocksdb_options_set_target_file_size_base*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_target_file_size_base", dynlib: librocksdb.} + +proc rocksdb_options_get_target_file_size_base*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_target_file_size_base", dynlib: librocksdb +.} + +proc rocksdb_options_set_target_file_size_multiplier*( + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, importc: "rocksdb_options_set_target_file_size_multiplier", dynlib: librocksdb +.} + +proc rocksdb_options_get_target_file_size_multiplier*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_target_file_size_multiplier", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_bytes_for_level_base*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_max_bytes_for_level_base", dynlib: librocksdb.} + +proc rocksdb_options_get_max_bytes_for_level_base*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_max_bytes_for_level_base", dynlib: librocksdb +.} + proc rocksdb_options_set_level_compaction_dynamic_level_bytes*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_level_compaction_dynamic_level_bytes", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_level_compaction_dynamic_level_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_get_level_compaction_dynamic_level_bytes*( - a1: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_level_compaction_dynamic_level_bytes", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_level_compaction_dynamic_level_bytes", + dynlib: librocksdb +.} + proc rocksdb_options_set_max_bytes_for_level_multiplier*( - a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl, - importc: "rocksdb_options_set_max_bytes_for_level_multiplier", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cdouble +) {. + cdecl, + importc: "rocksdb_options_set_max_bytes_for_level_multiplier", + dynlib: librocksdb +.} + proc rocksdb_options_get_max_bytes_for_level_multiplier*( - a1: ptr rocksdb_options_t): cdouble {.cdecl, importc: "rocksdb_options_get_max_bytes_for_level_multiplier", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cdouble {. + cdecl, + importc: "rocksdb_options_get_max_bytes_for_level_multiplier", + dynlib: librocksdb +.} + proc rocksdb_options_set_max_bytes_for_level_multiplier_additional*( - a1: ptr rocksdb_options_t; level_values: ptr cint; num_levels: csize_t) {.cdecl, - importc: "rocksdb_options_set_max_bytes_for_level_multiplier_additional", - dynlib: librocksdb.} -proc rocksdb_options_enable_statistics*(a1: ptr rocksdb_options_t) {.cdecl, - importc: "rocksdb_options_enable_statistics", dynlib: librocksdb.} -proc rocksdb_options_set_ttl*(a1: ptr rocksdb_options_t; a2: uint64) {.cdecl, - importc: "rocksdb_options_set_ttl", dynlib: librocksdb.} -proc rocksdb_options_get_ttl*(a1: ptr rocksdb_options_t): uint64 {.cdecl, - importc: "rocksdb_options_get_ttl", dynlib: librocksdb.} -proc rocksdb_options_set_periodic_compaction_seconds*(a1: ptr rocksdb_options_t; - a2: uint64) {.cdecl, - importc: "rocksdb_options_set_periodic_compaction_seconds", - dynlib: librocksdb.} -proc rocksdb_options_get_periodic_compaction_seconds*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_periodic_compaction_seconds", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, level_values: ptr cint, num_levels: csize_t +) {. + cdecl, + importc: "rocksdb_options_set_max_bytes_for_level_multiplier_additional", + dynlib: librocksdb +.} + +proc rocksdb_options_enable_statistics*( + a1: ptr rocksdb_options_t +) {.cdecl, importc: "rocksdb_options_enable_statistics", dynlib: librocksdb.} + +proc rocksdb_options_set_ttl*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_ttl", dynlib: librocksdb.} + +proc rocksdb_options_get_ttl*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl, importc: "rocksdb_options_get_ttl", dynlib: librocksdb.} + +proc rocksdb_options_set_periodic_compaction_seconds*( + a1: ptr rocksdb_options_t, a2: uint64 +) {. + cdecl, importc: "rocksdb_options_set_periodic_compaction_seconds", dynlib: librocksdb +.} + +proc rocksdb_options_get_periodic_compaction_seconds*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_periodic_compaction_seconds", dynlib: librocksdb +.} + const rocksdb_statistics_level_disable_all* = 0 rocksdb_statistics_level_except_tickers* = rocksdb_statistics_level_disable_all @@ -1296,389 +2378,810 @@ const rocksdb_statistics_level_except_time_for_mutex* = 4 rocksdb_statistics_level_all* = 5 -proc rocksdb_options_set_statistics_level*(a1: ptr rocksdb_options_t; level: cint) {. - cdecl, importc: "rocksdb_options_set_statistics_level", dynlib: librocksdb.} -proc rocksdb_options_get_statistics_level*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_statistics_level", dynlib: librocksdb.} +proc rocksdb_options_set_statistics_level*( + a1: ptr rocksdb_options_t, level: cint +) {.cdecl, importc: "rocksdb_options_set_statistics_level", dynlib: librocksdb.} + +proc rocksdb_options_get_statistics_level*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_statistics_level", dynlib: librocksdb.} + proc rocksdb_options_set_skip_stats_update_on_db_open*( - opt: ptr rocksdb_options_t; val: uint8) {.cdecl, - importc: "rocksdb_options_set_skip_stats_update_on_db_open", - dynlib: librocksdb.} -proc rocksdb_options_get_skip_stats_update_on_db_open*(opt: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_skip_stats_update_on_db_open", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t, val: uint8 +) {. + cdecl, importc: "rocksdb_options_set_skip_stats_update_on_db_open", dynlib: librocksdb +.} + +proc rocksdb_options_get_skip_stats_update_on_db_open*( + opt: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_skip_stats_update_on_db_open", dynlib: librocksdb +.} + proc rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open*( - opt: ptr rocksdb_options_t; val: uint8) {.cdecl, - importc: "rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t, val: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open", + dynlib: librocksdb +.} + proc rocksdb_options_get_skip_checking_sst_file_sizes_on_db_open*( - opt: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_skip_checking_sst_file_sizes_on_db_open", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_skip_checking_sst_file_sizes_on_db_open", + dynlib: librocksdb +.} + ## Blob Options Settings -proc rocksdb_options_set_enable_blob_files*(opt: ptr rocksdb_options_t; val: uint8) {. - cdecl, importc: "rocksdb_options_set_enable_blob_files", dynlib: librocksdb.} -proc rocksdb_options_get_enable_blob_files*(opt: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_enable_blob_files", dynlib: librocksdb.} -proc rocksdb_options_set_min_blob_size*(opt: ptr rocksdb_options_t; val: uint64) {. - cdecl, importc: "rocksdb_options_set_min_blob_size", dynlib: librocksdb.} -proc rocksdb_options_get_min_blob_size*(opt: ptr rocksdb_options_t): uint64 {.cdecl, - importc: "rocksdb_options_get_min_blob_size", dynlib: librocksdb.} -proc rocksdb_options_set_blob_file_size*(opt: ptr rocksdb_options_t; val: uint64) {. - cdecl, importc: "rocksdb_options_set_blob_file_size", dynlib: librocksdb.} -proc rocksdb_options_get_blob_file_size*(opt: ptr rocksdb_options_t): uint64 {.cdecl, - importc: "rocksdb_options_get_blob_file_size", dynlib: librocksdb.} -proc rocksdb_options_set_blob_compression_type*(opt: ptr rocksdb_options_t; - val: cint) {.cdecl, importc: "rocksdb_options_set_blob_compression_type", - dynlib: librocksdb.} -proc rocksdb_options_get_blob_compression_type*(opt: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_blob_compression_type", dynlib: librocksdb.} -proc rocksdb_options_set_enable_blob_gc*(opt: ptr rocksdb_options_t; val: uint8) {. - cdecl, importc: "rocksdb_options_set_enable_blob_gc", dynlib: librocksdb.} -proc rocksdb_options_get_enable_blob_gc*(opt: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_enable_blob_gc", dynlib: librocksdb.} -proc rocksdb_options_set_blob_gc_age_cutoff*(opt: ptr rocksdb_options_t; - val: cdouble) {.cdecl, importc: "rocksdb_options_set_blob_gc_age_cutoff", - dynlib: librocksdb.} -proc rocksdb_options_get_blob_gc_age_cutoff*(opt: ptr rocksdb_options_t): cdouble {. - cdecl, importc: "rocksdb_options_get_blob_gc_age_cutoff", dynlib: librocksdb.} -proc rocksdb_options_set_blob_gc_force_threshold*(opt: ptr rocksdb_options_t; - val: cdouble) {.cdecl, importc: "rocksdb_options_set_blob_gc_force_threshold", - dynlib: librocksdb.} -proc rocksdb_options_get_blob_gc_force_threshold*(opt: ptr rocksdb_options_t): cdouble {. - cdecl, importc: "rocksdb_options_get_blob_gc_force_threshold", - dynlib: librocksdb.} +proc rocksdb_options_set_enable_blob_files*( + opt: ptr rocksdb_options_t, val: uint8 +) {.cdecl, importc: "rocksdb_options_set_enable_blob_files", dynlib: librocksdb.} + +proc rocksdb_options_get_enable_blob_files*( + opt: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_enable_blob_files", dynlib: librocksdb.} + +proc rocksdb_options_set_min_blob_size*( + opt: ptr rocksdb_options_t, val: uint64 +) {.cdecl, importc: "rocksdb_options_set_min_blob_size", dynlib: librocksdb.} + +proc rocksdb_options_get_min_blob_size*( + opt: ptr rocksdb_options_t +): uint64 {.cdecl, importc: "rocksdb_options_get_min_blob_size", dynlib: librocksdb.} + +proc rocksdb_options_set_blob_file_size*( + opt: ptr rocksdb_options_t, val: uint64 +) {.cdecl, importc: "rocksdb_options_set_blob_file_size", dynlib: librocksdb.} + +proc rocksdb_options_get_blob_file_size*( + opt: ptr rocksdb_options_t +): uint64 {.cdecl, importc: "rocksdb_options_get_blob_file_size", dynlib: librocksdb.} + +proc rocksdb_options_set_blob_compression_type*( + opt: ptr rocksdb_options_t, val: cint +) {.cdecl, importc: "rocksdb_options_set_blob_compression_type", dynlib: librocksdb.} + +proc rocksdb_options_get_blob_compression_type*( + opt: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_blob_compression_type", dynlib: librocksdb +.} + +proc rocksdb_options_set_enable_blob_gc*( + opt: ptr rocksdb_options_t, val: uint8 +) {.cdecl, importc: "rocksdb_options_set_enable_blob_gc", dynlib: librocksdb.} + +proc rocksdb_options_get_enable_blob_gc*( + opt: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_enable_blob_gc", dynlib: librocksdb.} + +proc rocksdb_options_set_blob_gc_age_cutoff*( + opt: ptr rocksdb_options_t, val: cdouble +) {.cdecl, importc: "rocksdb_options_set_blob_gc_age_cutoff", dynlib: librocksdb.} + +proc rocksdb_options_get_blob_gc_age_cutoff*( + opt: ptr rocksdb_options_t +): cdouble {. + cdecl, importc: "rocksdb_options_get_blob_gc_age_cutoff", dynlib: librocksdb +.} + +proc rocksdb_options_set_blob_gc_force_threshold*( + opt: ptr rocksdb_options_t, val: cdouble +) {.cdecl, importc: "rocksdb_options_set_blob_gc_force_threshold", dynlib: librocksdb.} + +proc rocksdb_options_get_blob_gc_force_threshold*( + opt: ptr rocksdb_options_t +): cdouble {. + cdecl, importc: "rocksdb_options_get_blob_gc_force_threshold", dynlib: librocksdb +.} + proc rocksdb_options_set_blob_compaction_readahead_size*( - opt: ptr rocksdb_options_t; val: uint64) {.cdecl, - importc: "rocksdb_options_set_blob_compaction_readahead_size", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t, val: uint64 +) {. + cdecl, + importc: "rocksdb_options_set_blob_compaction_readahead_size", + dynlib: librocksdb +.} + proc rocksdb_options_get_blob_compaction_readahead_size*( - opt: ptr rocksdb_options_t): uint64 {.cdecl, importc: "rocksdb_options_get_blob_compaction_readahead_size", - dynlib: librocksdb.} -proc rocksdb_options_set_blob_file_starting_level*(opt: ptr rocksdb_options_t; - val: cint) {.cdecl, importc: "rocksdb_options_set_blob_file_starting_level", - dynlib: librocksdb.} -proc rocksdb_options_get_blob_file_starting_level*(opt: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_blob_file_starting_level", - dynlib: librocksdb.} -proc rocksdb_options_set_blob_cache*(opt: ptr rocksdb_options_t; - blob_cache: ptr rocksdb_cache_t) {.cdecl, - importc: "rocksdb_options_set_blob_cache", dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): uint64 {. + cdecl, + importc: "rocksdb_options_get_blob_compaction_readahead_size", + dynlib: librocksdb +.} + +proc rocksdb_options_set_blob_file_starting_level*( + opt: ptr rocksdb_options_t, val: cint +) {.cdecl, importc: "rocksdb_options_set_blob_file_starting_level", dynlib: librocksdb.} + +proc rocksdb_options_get_blob_file_starting_level*( + opt: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_blob_file_starting_level", dynlib: librocksdb +.} + +proc rocksdb_options_set_blob_cache*( + opt: ptr rocksdb_options_t, blob_cache: ptr rocksdb_cache_t +) {.cdecl, importc: "rocksdb_options_set_blob_cache", dynlib: librocksdb.} + const rocksdb_prepopulate_blob_disable* = 0 rocksdb_prepopulate_blob_flush_only* = 1 -proc rocksdb_options_set_prepopulate_blob_cache*(opt: ptr rocksdb_options_t; - val: cint) {.cdecl, importc: "rocksdb_options_set_prepopulate_blob_cache", - dynlib: librocksdb.} -proc rocksdb_options_get_prepopulate_blob_cache*(opt: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_prepopulate_blob_cache", - dynlib: librocksdb.} +proc rocksdb_options_set_prepopulate_blob_cache*( + opt: ptr rocksdb_options_t, val: cint +) {.cdecl, importc: "rocksdb_options_set_prepopulate_blob_cache", dynlib: librocksdb.} + +proc rocksdb_options_get_prepopulate_blob_cache*( + opt: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_prepopulate_blob_cache", dynlib: librocksdb +.} + ## returns a pointer to a malloc()-ed, null terminated string -proc rocksdb_options_statistics_get_string*(opt: ptr rocksdb_options_t): cstring {. - cdecl, importc: "rocksdb_options_statistics_get_string", dynlib: librocksdb.} -proc rocksdb_options_statistics_get_ticker_count*(opt: ptr rocksdb_options_t; - ticker_type: uint32): uint64 {.cdecl, importc: "rocksdb_options_statistics_get_ticker_count", - dynlib: librocksdb.} -proc rocksdb_options_statistics_get_histogram_data*(opt: ptr rocksdb_options_t; - histogram_type: uint32; data: ptr rocksdb_statistics_histogram_data_t) {.cdecl, - importc: "rocksdb_options_statistics_get_histogram_data", dynlib: librocksdb.} -proc rocksdb_options_set_max_write_buffer_number*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_max_write_buffer_number", - dynlib: librocksdb.} -proc rocksdb_options_get_max_write_buffer_number*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_max_write_buffer_number", - dynlib: librocksdb.} +proc rocksdb_options_statistics_get_string*( + opt: ptr rocksdb_options_t +): cstring {. + cdecl, importc: "rocksdb_options_statistics_get_string", dynlib: librocksdb +.} + +proc rocksdb_options_statistics_get_ticker_count*( + opt: ptr rocksdb_options_t, ticker_type: uint32 +): uint64 {. + cdecl, importc: "rocksdb_options_statistics_get_ticker_count", dynlib: librocksdb +.} + +proc rocksdb_options_statistics_get_histogram_data*( + opt: ptr rocksdb_options_t, + histogram_type: uint32, + data: ptr rocksdb_statistics_histogram_data_t, +) {. + cdecl, importc: "rocksdb_options_statistics_get_histogram_data", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_write_buffer_number*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_max_write_buffer_number", dynlib: librocksdb.} + +proc rocksdb_options_get_max_write_buffer_number*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_max_write_buffer_number", dynlib: librocksdb +.} + proc rocksdb_options_set_min_write_buffer_number_to_merge*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl, importc: "rocksdb_options_set_min_write_buffer_number_to_merge", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_options_set_min_write_buffer_number_to_merge", + dynlib: librocksdb +.} + proc rocksdb_options_get_min_write_buffer_number_to_merge*( - a1: ptr rocksdb_options_t): cint {.cdecl, importc: "rocksdb_options_get_min_write_buffer_number_to_merge", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cint {. + cdecl, + importc: "rocksdb_options_get_min_write_buffer_number_to_merge", + dynlib: librocksdb +.} + proc rocksdb_options_set_max_write_buffer_number_to_maintain*( - a1: ptr rocksdb_options_t; a2: cint) {.cdecl, importc: "rocksdb_options_set_max_write_buffer_number_to_maintain", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_options_set_max_write_buffer_number_to_maintain", + dynlib: librocksdb +.} + proc rocksdb_options_get_max_write_buffer_number_to_maintain*( - a1: ptr rocksdb_options_t): cint {.cdecl, importc: "rocksdb_options_get_max_write_buffer_number_to_maintain", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cint {. + cdecl, + importc: "rocksdb_options_get_max_write_buffer_number_to_maintain", + dynlib: librocksdb +.} + proc rocksdb_options_set_max_write_buffer_size_to_maintain*( - a1: ptr rocksdb_options_t; a2: int64) {.cdecl, importc: "rocksdb_options_set_max_write_buffer_size_to_maintain", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: int64 +) {. + cdecl, + importc: "rocksdb_options_set_max_write_buffer_size_to_maintain", + dynlib: librocksdb +.} + proc rocksdb_options_get_max_write_buffer_size_to_maintain*( - a1: ptr rocksdb_options_t): int64 {.cdecl, importc: "rocksdb_options_get_max_write_buffer_size_to_maintain", - dynlib: librocksdb.} -proc rocksdb_options_set_enable_pipelined_write*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl, importc: "rocksdb_options_set_enable_pipelined_write", - dynlib: librocksdb.} -proc rocksdb_options_get_enable_pipelined_write*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_enable_pipelined_write", - dynlib: librocksdb.} -proc rocksdb_options_set_unordered_write*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_unordered_write", dynlib: librocksdb.} -proc rocksdb_options_get_unordered_write*(a1: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_unordered_write", dynlib: librocksdb.} -proc rocksdb_options_set_max_subcompactions*(a1: ptr rocksdb_options_t; a2: uint32) {. - cdecl, importc: "rocksdb_options_set_max_subcompactions", dynlib: librocksdb.} -proc rocksdb_options_get_max_subcompactions*(a1: ptr rocksdb_options_t): uint32 {. - cdecl, importc: "rocksdb_options_get_max_subcompactions", dynlib: librocksdb.} -proc rocksdb_options_set_max_background_jobs*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_max_background_jobs", dynlib: librocksdb.} -proc rocksdb_options_get_max_background_jobs*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_max_background_jobs", dynlib: librocksdb.} -proc rocksdb_options_set_max_background_compactions*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_max_background_compactions", - dynlib: librocksdb.} -proc rocksdb_options_get_max_background_compactions*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_max_background_compactions", - dynlib: librocksdb.} -proc rocksdb_options_set_max_background_flushes*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_max_background_flushes", - dynlib: librocksdb.} -proc rocksdb_options_get_max_background_flushes*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_max_background_flushes", - dynlib: librocksdb.} -proc rocksdb_options_set_max_log_file_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl, importc: "rocksdb_options_set_max_log_file_size", dynlib: librocksdb.} -proc rocksdb_options_get_max_log_file_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_max_log_file_size", dynlib: librocksdb.} -proc rocksdb_options_set_log_file_time_to_roll*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_log_file_time_to_roll", - dynlib: librocksdb.} -proc rocksdb_options_get_log_file_time_to_roll*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_log_file_time_to_roll", dynlib: librocksdb.} -proc rocksdb_options_set_keep_log_file_num*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl, importc: "rocksdb_options_set_keep_log_file_num", dynlib: librocksdb.} -proc rocksdb_options_get_keep_log_file_num*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_keep_log_file_num", dynlib: librocksdb.} -proc rocksdb_options_set_recycle_log_file_num*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_recycle_log_file_num", - dynlib: librocksdb.} -proc rocksdb_options_get_recycle_log_file_num*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_recycle_log_file_num", dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): int64 {. + cdecl, + importc: "rocksdb_options_get_max_write_buffer_size_to_maintain", + dynlib: librocksdb +.} + +proc rocksdb_options_set_enable_pipelined_write*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_enable_pipelined_write", dynlib: librocksdb.} + +proc rocksdb_options_get_enable_pipelined_write*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_enable_pipelined_write", dynlib: librocksdb +.} + +proc rocksdb_options_set_unordered_write*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_unordered_write", dynlib: librocksdb.} + +proc rocksdb_options_get_unordered_write*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_unordered_write", dynlib: librocksdb.} + +proc rocksdb_options_set_max_subcompactions*( + a1: ptr rocksdb_options_t, a2: uint32 +) {.cdecl, importc: "rocksdb_options_set_max_subcompactions", dynlib: librocksdb.} + +proc rocksdb_options_get_max_subcompactions*( + a1: ptr rocksdb_options_t +): uint32 {. + cdecl, importc: "rocksdb_options_get_max_subcompactions", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_background_jobs*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_max_background_jobs", dynlib: librocksdb.} + +proc rocksdb_options_get_max_background_jobs*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_max_background_jobs", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_background_compactions*( + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, importc: "rocksdb_options_set_max_background_compactions", dynlib: librocksdb +.} + +proc rocksdb_options_get_max_background_compactions*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_max_background_compactions", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_background_flushes*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_max_background_flushes", dynlib: librocksdb.} + +proc rocksdb_options_get_max_background_flushes*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_max_background_flushes", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_log_file_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_max_log_file_size", dynlib: librocksdb.} + +proc rocksdb_options_get_max_log_file_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_max_log_file_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_log_file_time_to_roll*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_log_file_time_to_roll", dynlib: librocksdb.} + +proc rocksdb_options_get_log_file_time_to_roll*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_log_file_time_to_roll", dynlib: librocksdb +.} + +proc rocksdb_options_set_keep_log_file_num*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_keep_log_file_num", dynlib: librocksdb.} + +proc rocksdb_options_get_keep_log_file_num*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_keep_log_file_num", dynlib: librocksdb +.} + +proc rocksdb_options_set_recycle_log_file_num*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_recycle_log_file_num", dynlib: librocksdb.} + +proc rocksdb_options_get_recycle_log_file_num*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_recycle_log_file_num", dynlib: librocksdb +.} + proc rocksdb_options_set_soft_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t; v: csize_t) {.cdecl, - importc: "rocksdb_options_set_soft_pending_compaction_bytes_limit", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t, v: csize_t +) {. + cdecl, + importc: "rocksdb_options_set_soft_pending_compaction_bytes_limit", + dynlib: librocksdb +.} + proc rocksdb_options_get_soft_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t): csize_t {.cdecl, importc: "rocksdb_options_get_soft_pending_compaction_bytes_limit", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): csize_t {. + cdecl, + importc: "rocksdb_options_get_soft_pending_compaction_bytes_limit", + dynlib: librocksdb +.} + proc rocksdb_options_set_hard_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t; v: csize_t) {.cdecl, - importc: "rocksdb_options_set_hard_pending_compaction_bytes_limit", - dynlib: librocksdb.} + opt: ptr rocksdb_options_t, v: csize_t +) {. + cdecl, + importc: "rocksdb_options_set_hard_pending_compaction_bytes_limit", + dynlib: librocksdb +.} + proc rocksdb_options_get_hard_pending_compaction_bytes_limit*( - opt: ptr rocksdb_options_t): csize_t {.cdecl, importc: "rocksdb_options_get_hard_pending_compaction_bytes_limit", - dynlib: librocksdb.} -proc rocksdb_options_set_max_manifest_file_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_max_manifest_file_size", - dynlib: librocksdb.} -proc rocksdb_options_get_max_manifest_file_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_max_manifest_file_size", - dynlib: librocksdb.} -proc rocksdb_options_set_table_cache_numshardbits*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_table_cache_numshardbits", - dynlib: librocksdb.} -proc rocksdb_options_get_table_cache_numshardbits*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_table_cache_numshardbits", - dynlib: librocksdb.} -proc rocksdb_options_set_arena_block_size*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl, importc: "rocksdb_options_set_arena_block_size", dynlib: librocksdb.} -proc rocksdb_options_get_arena_block_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_arena_block_size", dynlib: librocksdb.} -proc rocksdb_options_set_use_fsync*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl, - importc: "rocksdb_options_set_use_fsync", dynlib: librocksdb.} -proc rocksdb_options_get_use_fsync*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_use_fsync", dynlib: librocksdb.} -proc rocksdb_options_set_db_log_dir*(a1: ptr rocksdb_options_t; a2: cstring) {.cdecl, - importc: "rocksdb_options_set_db_log_dir", dynlib: librocksdb.} -proc rocksdb_options_set_wal_dir*(a1: ptr rocksdb_options_t; a2: cstring) {.cdecl, - importc: "rocksdb_options_set_wal_dir", dynlib: librocksdb.} -proc rocksdb_options_set_WAL_ttl_seconds*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl, importc: "rocksdb_options_set_WAL_ttl_seconds", dynlib: librocksdb.} -proc rocksdb_options_get_WAL_ttl_seconds*(a1: ptr rocksdb_options_t): uint64 {.cdecl, - importc: "rocksdb_options_get_WAL_ttl_seconds", dynlib: librocksdb.} -proc rocksdb_options_set_WAL_size_limit_MB*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl, importc: "rocksdb_options_set_WAL_size_limit_MB", dynlib: librocksdb.} -proc rocksdb_options_get_WAL_size_limit_MB*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_WAL_size_limit_MB", dynlib: librocksdb.} -proc rocksdb_options_set_manifest_preallocation_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, - importc: "rocksdb_options_set_manifest_preallocation_size", - dynlib: librocksdb.} -proc rocksdb_options_get_manifest_preallocation_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_manifest_preallocation_size", - dynlib: librocksdb.} -proc rocksdb_options_set_allow_mmap_reads*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_allow_mmap_reads", dynlib: librocksdb.} -proc rocksdb_options_get_allow_mmap_reads*(a1: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_allow_mmap_reads", dynlib: librocksdb.} -proc rocksdb_options_set_allow_mmap_writes*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_allow_mmap_writes", dynlib: librocksdb.} -proc rocksdb_options_get_allow_mmap_writes*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_allow_mmap_writes", dynlib: librocksdb.} -proc rocksdb_options_set_use_direct_reads*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_use_direct_reads", dynlib: librocksdb.} -proc rocksdb_options_get_use_direct_reads*(a1: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_use_direct_reads", dynlib: librocksdb.} + opt: ptr rocksdb_options_t +): csize_t {. + cdecl, + importc: "rocksdb_options_get_hard_pending_compaction_bytes_limit", + dynlib: librocksdb +.} + +proc rocksdb_options_set_max_manifest_file_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_max_manifest_file_size", dynlib: librocksdb.} + +proc rocksdb_options_get_max_manifest_file_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_max_manifest_file_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_table_cache_numshardbits*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_table_cache_numshardbits", dynlib: librocksdb.} + +proc rocksdb_options_get_table_cache_numshardbits*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_table_cache_numshardbits", dynlib: librocksdb +.} + +proc rocksdb_options_set_arena_block_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_arena_block_size", dynlib: librocksdb.} + +proc rocksdb_options_get_arena_block_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_arena_block_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_use_fsync*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_use_fsync", dynlib: librocksdb.} + +proc rocksdb_options_get_use_fsync*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_use_fsync", dynlib: librocksdb.} + +proc rocksdb_options_set_db_log_dir*( + a1: ptr rocksdb_options_t, a2: cstring +) {.cdecl, importc: "rocksdb_options_set_db_log_dir", dynlib: librocksdb.} + +proc rocksdb_options_set_wal_dir*( + a1: ptr rocksdb_options_t, a2: cstring +) {.cdecl, importc: "rocksdb_options_set_wal_dir", dynlib: librocksdb.} + +proc rocksdb_options_set_WAL_ttl_seconds*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_WAL_ttl_seconds", dynlib: librocksdb.} + +proc rocksdb_options_get_WAL_ttl_seconds*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl, importc: "rocksdb_options_get_WAL_ttl_seconds", dynlib: librocksdb.} + +proc rocksdb_options_set_WAL_size_limit_MB*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_WAL_size_limit_MB", dynlib: librocksdb.} + +proc rocksdb_options_get_WAL_size_limit_MB*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_WAL_size_limit_MB", dynlib: librocksdb +.} + +proc rocksdb_options_set_manifest_preallocation_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {. + cdecl, importc: "rocksdb_options_set_manifest_preallocation_size", dynlib: librocksdb +.} + +proc rocksdb_options_get_manifest_preallocation_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_manifest_preallocation_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_allow_mmap_reads*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_allow_mmap_reads", dynlib: librocksdb.} + +proc rocksdb_options_get_allow_mmap_reads*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_allow_mmap_reads", dynlib: librocksdb.} + +proc rocksdb_options_set_allow_mmap_writes*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_allow_mmap_writes", dynlib: librocksdb.} + +proc rocksdb_options_get_allow_mmap_writes*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_allow_mmap_writes", dynlib: librocksdb.} + +proc rocksdb_options_set_use_direct_reads*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_use_direct_reads", dynlib: librocksdb.} + +proc rocksdb_options_get_use_direct_reads*( + a1: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_use_direct_reads", dynlib: librocksdb.} + proc rocksdb_options_set_use_direct_io_for_flush_and_compaction*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_use_direct_io_for_flush_and_compaction", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_use_direct_io_for_flush_and_compaction", + dynlib: librocksdb +.} + proc rocksdb_options_get_use_direct_io_for_flush_and_compaction*( - a1: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_use_direct_io_for_flush_and_compaction", - dynlib: librocksdb.} -proc rocksdb_options_set_is_fd_close_on_exec*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_is_fd_close_on_exec", dynlib: librocksdb.} -proc rocksdb_options_get_is_fd_close_on_exec*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_is_fd_close_on_exec", dynlib: librocksdb.} -proc rocksdb_options_set_stats_dump_period_sec*(a1: ptr rocksdb_options_t; a2: cuint) {. - cdecl, importc: "rocksdb_options_set_stats_dump_period_sec", dynlib: librocksdb.} -proc rocksdb_options_get_stats_dump_period_sec*(a1: ptr rocksdb_options_t): cuint {. - cdecl, importc: "rocksdb_options_get_stats_dump_period_sec", dynlib: librocksdb.} -proc rocksdb_options_set_stats_persist_period_sec*(a1: ptr rocksdb_options_t; - a2: cuint) {.cdecl, importc: "rocksdb_options_set_stats_persist_period_sec", - dynlib: librocksdb.} -proc rocksdb_options_get_stats_persist_period_sec*(a1: ptr rocksdb_options_t): cuint {. - cdecl, importc: "rocksdb_options_get_stats_persist_period_sec", - dynlib: librocksdb.} -proc rocksdb_options_set_advise_random_on_open*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_advise_random_on_open", dynlib: librocksdb.} -proc rocksdb_options_get_advise_random_on_open*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_advise_random_on_open", dynlib: librocksdb.} -proc rocksdb_options_set_use_adaptive_mutex*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_use_adaptive_mutex", dynlib: librocksdb.} -proc rocksdb_options_get_use_adaptive_mutex*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_use_adaptive_mutex", dynlib: librocksdb.} -proc rocksdb_options_set_bytes_per_sync*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl, importc: "rocksdb_options_set_bytes_per_sync", dynlib: librocksdb.} -proc rocksdb_options_get_bytes_per_sync*(a1: ptr rocksdb_options_t): uint64 {.cdecl, - importc: "rocksdb_options_get_bytes_per_sync", dynlib: librocksdb.} -proc rocksdb_options_set_wal_bytes_per_sync*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl, importc: "rocksdb_options_set_wal_bytes_per_sync", dynlib: librocksdb.} -proc rocksdb_options_get_wal_bytes_per_sync*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_wal_bytes_per_sync", dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_use_direct_io_for_flush_and_compaction", + dynlib: librocksdb +.} + +proc rocksdb_options_set_is_fd_close_on_exec*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_is_fd_close_on_exec", dynlib: librocksdb.} + +proc rocksdb_options_get_is_fd_close_on_exec*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_is_fd_close_on_exec", dynlib: librocksdb +.} + +proc rocksdb_options_set_stats_dump_period_sec*( + a1: ptr rocksdb_options_t, a2: cuint +) {.cdecl, importc: "rocksdb_options_set_stats_dump_period_sec", dynlib: librocksdb.} + +proc rocksdb_options_get_stats_dump_period_sec*( + a1: ptr rocksdb_options_t +): cuint {. + cdecl, importc: "rocksdb_options_get_stats_dump_period_sec", dynlib: librocksdb +.} + +proc rocksdb_options_set_stats_persist_period_sec*( + a1: ptr rocksdb_options_t, a2: cuint +) {.cdecl, importc: "rocksdb_options_set_stats_persist_period_sec", dynlib: librocksdb.} + +proc rocksdb_options_get_stats_persist_period_sec*( + a1: ptr rocksdb_options_t +): cuint {. + cdecl, importc: "rocksdb_options_get_stats_persist_period_sec", dynlib: librocksdb +.} + +proc rocksdb_options_set_advise_random_on_open*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_advise_random_on_open", dynlib: librocksdb.} + +proc rocksdb_options_get_advise_random_on_open*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_advise_random_on_open", dynlib: librocksdb +.} + +proc rocksdb_options_set_use_adaptive_mutex*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_use_adaptive_mutex", dynlib: librocksdb.} + +proc rocksdb_options_get_use_adaptive_mutex*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_use_adaptive_mutex", dynlib: librocksdb +.} + +proc rocksdb_options_set_bytes_per_sync*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_bytes_per_sync", dynlib: librocksdb.} + +proc rocksdb_options_get_bytes_per_sync*( + a1: ptr rocksdb_options_t +): uint64 {.cdecl, importc: "rocksdb_options_get_bytes_per_sync", dynlib: librocksdb.} + +proc rocksdb_options_set_wal_bytes_per_sync*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_wal_bytes_per_sync", dynlib: librocksdb.} + +proc rocksdb_options_get_wal_bytes_per_sync*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_wal_bytes_per_sync", dynlib: librocksdb +.} + proc rocksdb_options_set_writable_file_max_buffer_size*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl, importc: "rocksdb_options_set_writable_file_max_buffer_size", - dynlib: librocksdb.} -proc rocksdb_options_get_writable_file_max_buffer_size*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_writable_file_max_buffer_size", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint64 +) {. + cdecl, + importc: "rocksdb_options_set_writable_file_max_buffer_size", + dynlib: librocksdb +.} + +proc rocksdb_options_get_writable_file_max_buffer_size*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, + importc: "rocksdb_options_get_writable_file_max_buffer_size", + dynlib: librocksdb +.} + proc rocksdb_options_set_allow_concurrent_memtable_write*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_allow_concurrent_memtable_write", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_allow_concurrent_memtable_write", + dynlib: librocksdb +.} + proc rocksdb_options_get_allow_concurrent_memtable_write*( - a1: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_allow_concurrent_memtable_write", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_allow_concurrent_memtable_write", + dynlib: librocksdb +.} + proc rocksdb_options_set_enable_write_thread_adaptive_yield*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_enable_write_thread_adaptive_yield", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_enable_write_thread_adaptive_yield", + dynlib: librocksdb +.} + proc rocksdb_options_get_enable_write_thread_adaptive_yield*( - a1: ptr rocksdb_options_t): uint8 {.cdecl, importc: "rocksdb_options_get_enable_write_thread_adaptive_yield", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_enable_write_thread_adaptive_yield", + dynlib: librocksdb +.} + proc rocksdb_options_set_max_sequential_skip_in_iterations*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl, importc: "rocksdb_options_set_max_sequential_skip_in_iterations", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint64 +) {. + cdecl, + importc: "rocksdb_options_set_max_sequential_skip_in_iterations", + dynlib: librocksdb +.} + proc rocksdb_options_get_max_sequential_skip_in_iterations*( - a1: ptr rocksdb_options_t): uint64 {.cdecl, importc: "rocksdb_options_get_max_sequential_skip_in_iterations", - dynlib: librocksdb.} -proc rocksdb_options_set_disable_auto_compactions*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_disable_auto_compactions", - dynlib: librocksdb.} -proc rocksdb_options_get_disable_auto_compactions*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_disable_auto_compactions", - dynlib: librocksdb.} -proc rocksdb_options_set_optimize_filters_for_hits*(a1: ptr rocksdb_options_t; - a2: cint) {.cdecl, importc: "rocksdb_options_set_optimize_filters_for_hits", - dynlib: librocksdb.} -proc rocksdb_options_get_optimize_filters_for_hits*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_optimize_filters_for_hits", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, + importc: "rocksdb_options_get_max_sequential_skip_in_iterations", + dynlib: librocksdb +.} + +proc rocksdb_options_set_disable_auto_compactions*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_disable_auto_compactions", dynlib: librocksdb.} + +proc rocksdb_options_get_disable_auto_compactions*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_disable_auto_compactions", dynlib: librocksdb +.} + +proc rocksdb_options_set_optimize_filters_for_hits*( + a1: ptr rocksdb_options_t, a2: cint +) {. + cdecl, importc: "rocksdb_options_set_optimize_filters_for_hits", dynlib: librocksdb +.} + +proc rocksdb_options_get_optimize_filters_for_hits*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_optimize_filters_for_hits", dynlib: librocksdb +.} + proc rocksdb_options_set_delete_obsolete_files_period_micros*( - a1: ptr rocksdb_options_t; a2: uint64) {.cdecl, importc: "rocksdb_options_set_delete_obsolete_files_period_micros", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint64 +) {. + cdecl, + importc: "rocksdb_options_set_delete_obsolete_files_period_micros", + dynlib: librocksdb +.} + proc rocksdb_options_get_delete_obsolete_files_period_micros*( - a1: ptr rocksdb_options_t): uint64 {.cdecl, importc: "rocksdb_options_get_delete_obsolete_files_period_micros", - dynlib: librocksdb.} -proc rocksdb_options_prepare_for_bulk_load*(a1: ptr rocksdb_options_t) {.cdecl, - importc: "rocksdb_options_prepare_for_bulk_load", dynlib: librocksdb.} -proc rocksdb_options_set_memtable_vector_rep*(a1: ptr rocksdb_options_t) {.cdecl, - importc: "rocksdb_options_set_memtable_vector_rep", dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, + importc: "rocksdb_options_get_delete_obsolete_files_period_micros", + dynlib: librocksdb +.} + +proc rocksdb_options_prepare_for_bulk_load*( + a1: ptr rocksdb_options_t +) {.cdecl, importc: "rocksdb_options_prepare_for_bulk_load", dynlib: librocksdb.} + +proc rocksdb_options_set_memtable_vector_rep*( + a1: ptr rocksdb_options_t +) {.cdecl, importc: "rocksdb_options_set_memtable_vector_rep", dynlib: librocksdb.} + proc rocksdb_options_set_memtable_prefix_bloom_size_ratio*( - a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl, - importc: "rocksdb_options_set_memtable_prefix_bloom_size_ratio", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cdouble +) {. + cdecl, + importc: "rocksdb_options_set_memtable_prefix_bloom_size_ratio", + dynlib: librocksdb +.} + proc rocksdb_options_get_memtable_prefix_bloom_size_ratio*( - a1: ptr rocksdb_options_t): cdouble {.cdecl, importc: "rocksdb_options_get_memtable_prefix_bloom_size_ratio", - dynlib: librocksdb.} -proc rocksdb_options_set_max_compaction_bytes*(a1: ptr rocksdb_options_t; a2: uint64) {. - cdecl, importc: "rocksdb_options_set_max_compaction_bytes", dynlib: librocksdb.} -proc rocksdb_options_get_max_compaction_bytes*(a1: ptr rocksdb_options_t): uint64 {. - cdecl, importc: "rocksdb_options_get_max_compaction_bytes", dynlib: librocksdb.} -proc rocksdb_options_set_hash_skip_list_rep*(a1: ptr rocksdb_options_t; a2: csize_t; - a3: int32; a4: int32) {.cdecl, importc: "rocksdb_options_set_hash_skip_list_rep", - dynlib: librocksdb.} -proc rocksdb_options_set_hash_link_list_rep*(a1: ptr rocksdb_options_t; a2: csize_t) {. - cdecl, importc: "rocksdb_options_set_hash_link_list_rep", dynlib: librocksdb.} -proc rocksdb_options_set_plain_table_factory*(a1: ptr rocksdb_options_t; a2: uint32; - a3: cint; a4: cdouble; a5: csize_t; a6: csize_t; a7: char; a8: uint8; a9: uint8) {.cdecl, - importc: "rocksdb_options_set_plain_table_factory", dynlib: librocksdb.} -proc rocksdb_options_set_min_level_to_compress*(opt: ptr rocksdb_options_t; - level: cint) {.cdecl, importc: "rocksdb_options_set_min_level_to_compress", - dynlib: librocksdb.} -proc rocksdb_options_set_memtable_huge_page_size*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_memtable_huge_page_size", - dynlib: librocksdb.} -proc rocksdb_options_get_memtable_huge_page_size*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_memtable_huge_page_size", - dynlib: librocksdb.} -proc rocksdb_options_set_max_successive_merges*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_max_successive_merges", - dynlib: librocksdb.} -proc rocksdb_options_get_max_successive_merges*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_max_successive_merges", dynlib: librocksdb.} -proc rocksdb_options_set_bloom_locality*(a1: ptr rocksdb_options_t; a2: uint32) {. - cdecl, importc: "rocksdb_options_set_bloom_locality", dynlib: librocksdb.} -proc rocksdb_options_get_bloom_locality*(a1: ptr rocksdb_options_t): uint32 {.cdecl, - importc: "rocksdb_options_get_bloom_locality", dynlib: librocksdb.} -proc rocksdb_options_set_inplace_update_support*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl, importc: "rocksdb_options_set_inplace_update_support", - dynlib: librocksdb.} -proc rocksdb_options_get_inplace_update_support*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_inplace_update_support", - dynlib: librocksdb.} -proc rocksdb_options_set_inplace_update_num_locks*(a1: ptr rocksdb_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_options_set_inplace_update_num_locks", - dynlib: librocksdb.} -proc rocksdb_options_get_inplace_update_num_locks*(a1: ptr rocksdb_options_t): csize_t {. - cdecl, importc: "rocksdb_options_get_inplace_update_num_locks", - dynlib: librocksdb.} -proc rocksdb_options_set_report_bg_io_stats*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_report_bg_io_stats", dynlib: librocksdb.} -proc rocksdb_options_get_report_bg_io_stats*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_report_bg_io_stats", dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cdouble {. + cdecl, + importc: "rocksdb_options_get_memtable_prefix_bloom_size_ratio", + dynlib: librocksdb +.} + +proc rocksdb_options_set_max_compaction_bytes*( + a1: ptr rocksdb_options_t, a2: uint64 +) {.cdecl, importc: "rocksdb_options_set_max_compaction_bytes", dynlib: librocksdb.} + +proc rocksdb_options_get_max_compaction_bytes*( + a1: ptr rocksdb_options_t +): uint64 {. + cdecl, importc: "rocksdb_options_get_max_compaction_bytes", dynlib: librocksdb +.} + +proc rocksdb_options_set_hash_skip_list_rep*( + a1: ptr rocksdb_options_t, a2: csize_t, a3: int32, a4: int32 +) {.cdecl, importc: "rocksdb_options_set_hash_skip_list_rep", dynlib: librocksdb.} + +proc rocksdb_options_set_hash_link_list_rep*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_hash_link_list_rep", dynlib: librocksdb.} + +proc rocksdb_options_set_plain_table_factory*( + a1: ptr rocksdb_options_t, + a2: uint32, + a3: cint, + a4: cdouble, + a5: csize_t, + a6: csize_t, + a7: char, + a8: uint8, + a9: uint8, +) {.cdecl, importc: "rocksdb_options_set_plain_table_factory", dynlib: librocksdb.} + +proc rocksdb_options_set_min_level_to_compress*( + opt: ptr rocksdb_options_t, level: cint +) {.cdecl, importc: "rocksdb_options_set_min_level_to_compress", dynlib: librocksdb.} + +proc rocksdb_options_set_memtable_huge_page_size*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_memtable_huge_page_size", dynlib: librocksdb.} + +proc rocksdb_options_get_memtable_huge_page_size*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_memtable_huge_page_size", dynlib: librocksdb +.} + +proc rocksdb_options_set_max_successive_merges*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_max_successive_merges", dynlib: librocksdb.} + +proc rocksdb_options_get_max_successive_merges*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_max_successive_merges", dynlib: librocksdb +.} + +proc rocksdb_options_set_bloom_locality*( + a1: ptr rocksdb_options_t, a2: uint32 +) {.cdecl, importc: "rocksdb_options_set_bloom_locality", dynlib: librocksdb.} + +proc rocksdb_options_get_bloom_locality*( + a1: ptr rocksdb_options_t +): uint32 {.cdecl, importc: "rocksdb_options_get_bloom_locality", dynlib: librocksdb.} + +proc rocksdb_options_set_inplace_update_support*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_inplace_update_support", dynlib: librocksdb.} + +proc rocksdb_options_get_inplace_update_support*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_inplace_update_support", dynlib: librocksdb +.} + +proc rocksdb_options_set_inplace_update_num_locks*( + a1: ptr rocksdb_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_options_set_inplace_update_num_locks", dynlib: librocksdb.} + +proc rocksdb_options_get_inplace_update_num_locks*( + a1: ptr rocksdb_options_t +): csize_t {. + cdecl, importc: "rocksdb_options_get_inplace_update_num_locks", dynlib: librocksdb +.} + +proc rocksdb_options_set_report_bg_io_stats*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_report_bg_io_stats", dynlib: librocksdb.} + +proc rocksdb_options_get_report_bg_io_stats*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, importc: "rocksdb_options_get_report_bg_io_stats", dynlib: librocksdb +.} + proc rocksdb_options_set_avoid_unnecessary_blocking_io*( - a1: ptr rocksdb_options_t; a2: uint8) {.cdecl, importc: "rocksdb_options_set_avoid_unnecessary_blocking_io", - dynlib: librocksdb.} -proc rocksdb_options_get_avoid_unnecessary_blocking_io*(a1: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_avoid_unnecessary_blocking_io", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_options_set_avoid_unnecessary_blocking_io", + dynlib: librocksdb +.} + +proc rocksdb_options_get_avoid_unnecessary_blocking_io*( + a1: ptr rocksdb_options_t +): uint8 {. + cdecl, + importc: "rocksdb_options_get_avoid_unnecessary_blocking_io", + dynlib: librocksdb +.} + proc rocksdb_options_set_experimental_mempurge_threshold*( - a1: ptr rocksdb_options_t; a2: cdouble) {.cdecl, - importc: "rocksdb_options_set_experimental_mempurge_threshold", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, a2: cdouble +) {. + cdecl, + importc: "rocksdb_options_set_experimental_mempurge_threshold", + dynlib: librocksdb +.} + proc rocksdb_options_get_experimental_mempurge_threshold*( - a1: ptr rocksdb_options_t): cdouble {.cdecl, importc: "rocksdb_options_get_experimental_mempurge_threshold", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t +): cdouble {. + cdecl, + importc: "rocksdb_options_get_experimental_mempurge_threshold", + dynlib: librocksdb +.} + const rocksdb_tolerate_corrupted_tail_records_recovery* = 0 rocksdb_absolute_consistency_recovery* = 1 rocksdb_point_in_time_recovery* = 2 rocksdb_skip_any_corrupted_records_recovery* = 3 -proc rocksdb_options_set_wal_recovery_mode*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_wal_recovery_mode", dynlib: librocksdb.} -proc rocksdb_options_get_wal_recovery_mode*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_wal_recovery_mode", dynlib: librocksdb.} +proc rocksdb_options_set_wal_recovery_mode*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_wal_recovery_mode", dynlib: librocksdb.} + +proc rocksdb_options_get_wal_recovery_mode*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_wal_recovery_mode", dynlib: librocksdb.} + const rocksdb_no_compression* = 0 rocksdb_snappy_compression* = 1 @@ -1689,71 +3192,126 @@ const rocksdb_xpress_compression* = 6 rocksdb_zstd_compression* = 7 -proc rocksdb_options_set_compression*(a1: ptr rocksdb_options_t; a2: cint) {.cdecl, - importc: "rocksdb_options_set_compression", dynlib: librocksdb.} -proc rocksdb_options_get_compression*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_compression", dynlib: librocksdb.} -proc rocksdb_options_set_bottommost_compression*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_bottommost_compression", - dynlib: librocksdb.} -proc rocksdb_options_get_bottommost_compression*(a1: ptr rocksdb_options_t): cint {. - cdecl, importc: "rocksdb_options_get_bottommost_compression", - dynlib: librocksdb.} +proc rocksdb_options_set_compression*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_compression", dynlib: librocksdb.} + +proc rocksdb_options_get_compression*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_compression", dynlib: librocksdb.} + +proc rocksdb_options_set_bottommost_compression*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_bottommost_compression", dynlib: librocksdb.} + +proc rocksdb_options_get_bottommost_compression*( + a1: ptr rocksdb_options_t +): cint {. + cdecl, importc: "rocksdb_options_get_bottommost_compression", dynlib: librocksdb +.} + const rocksdb_level_compaction* = 0 rocksdb_universal_compaction* = 1 rocksdb_fifo_compaction* = 2 -proc rocksdb_options_set_compaction_style*(a1: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_compaction_style", dynlib: librocksdb.} -proc rocksdb_options_get_compaction_style*(a1: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_compaction_style", dynlib: librocksdb.} -proc rocksdb_options_set_universal_compaction_options*(a1: ptr rocksdb_options_t; - a2: ptr rocksdb_universal_compaction_options_t) {.cdecl, - importc: "rocksdb_options_set_universal_compaction_options", - dynlib: librocksdb.} -proc rocksdb_options_set_fifo_compaction_options*(opt: ptr rocksdb_options_t; - fifo: ptr rocksdb_fifo_compaction_options_t) {.cdecl, - importc: "rocksdb_options_set_fifo_compaction_options", dynlib: librocksdb.} -proc rocksdb_options_set_ratelimiter*(opt: ptr rocksdb_options_t; - limiter: ptr rocksdb_ratelimiter_t) {.cdecl, - importc: "rocksdb_options_set_ratelimiter", dynlib: librocksdb.} -proc rocksdb_options_set_atomic_flush*(opt: ptr rocksdb_options_t; a2: uint8) {.cdecl, - importc: "rocksdb_options_set_atomic_flush", dynlib: librocksdb.} -proc rocksdb_options_get_atomic_flush*(opt: ptr rocksdb_options_t): uint8 {.cdecl, - importc: "rocksdb_options_get_atomic_flush", dynlib: librocksdb.} -proc rocksdb_options_set_row_cache*(opt: ptr rocksdb_options_t; - cache: ptr rocksdb_cache_t) {.cdecl, - importc: "rocksdb_options_set_row_cache", dynlib: librocksdb.} +proc rocksdb_options_set_compaction_style*( + a1: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_compaction_style", dynlib: librocksdb.} + +proc rocksdb_options_get_compaction_style*( + a1: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_compaction_style", dynlib: librocksdb.} + +proc rocksdb_options_set_universal_compaction_options*( + a1: ptr rocksdb_options_t, a2: ptr rocksdb_universal_compaction_options_t +) {. + cdecl, importc: "rocksdb_options_set_universal_compaction_options", dynlib: librocksdb +.} + +proc rocksdb_options_set_fifo_compaction_options*( + opt: ptr rocksdb_options_t, fifo: ptr rocksdb_fifo_compaction_options_t +) {.cdecl, importc: "rocksdb_options_set_fifo_compaction_options", dynlib: librocksdb.} + +proc rocksdb_options_set_ratelimiter*( + opt: ptr rocksdb_options_t, limiter: ptr rocksdb_ratelimiter_t +) {.cdecl, importc: "rocksdb_options_set_ratelimiter", dynlib: librocksdb.} + +proc rocksdb_options_set_atomic_flush*( + opt: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_atomic_flush", dynlib: librocksdb.} + +proc rocksdb_options_get_atomic_flush*( + opt: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_atomic_flush", dynlib: librocksdb.} + +proc rocksdb_options_set_row_cache*( + opt: ptr rocksdb_options_t, cache: ptr rocksdb_cache_t +) {.cdecl, importc: "rocksdb_options_set_row_cache", dynlib: librocksdb.} + proc rocksdb_options_add_compact_on_deletion_collector_factory*( - a1: ptr rocksdb_options_t; window_size: csize_t; num_dels_trigger: csize_t) {. - cdecl, importc: "rocksdb_options_add_compact_on_deletion_collector_factory", - dynlib: librocksdb.} + a1: ptr rocksdb_options_t, window_size: csize_t, num_dels_trigger: csize_t +) {. + cdecl, + importc: "rocksdb_options_add_compact_on_deletion_collector_factory", + dynlib: librocksdb +.} + proc rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio*( - a1: ptr rocksdb_options_t; window_size: csize_t; num_dels_trigger: csize_t; - deletion_ratio: cdouble) {.cdecl, importc: "rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio", - dynlib: librocksdb.} -proc rocksdb_options_set_manual_wal_flush*(opt: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_manual_wal_flush", dynlib: librocksdb.} -proc rocksdb_options_get_manual_wal_flush*(opt: ptr rocksdb_options_t): uint8 {. - cdecl, importc: "rocksdb_options_get_manual_wal_flush", dynlib: librocksdb.} -proc rocksdb_options_set_wal_compression*(opt: ptr rocksdb_options_t; a2: cint) {. - cdecl, importc: "rocksdb_options_set_wal_compression", dynlib: librocksdb.} -proc rocksdb_options_get_wal_compression*(opt: ptr rocksdb_options_t): cint {.cdecl, - importc: "rocksdb_options_get_wal_compression", dynlib: librocksdb.} + a1: ptr rocksdb_options_t, + window_size: csize_t, + num_dels_trigger: csize_t, + deletion_ratio: cdouble, +) {. + cdecl, + importc: "rocksdb_options_add_compact_on_deletion_collector_factory_del_ratio", + dynlib: librocksdb +.} + +proc rocksdb_options_set_manual_wal_flush*( + opt: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_manual_wal_flush", dynlib: librocksdb.} + +proc rocksdb_options_get_manual_wal_flush*( + opt: ptr rocksdb_options_t +): uint8 {.cdecl, importc: "rocksdb_options_get_manual_wal_flush", dynlib: librocksdb.} + +proc rocksdb_options_set_wal_compression*( + opt: ptr rocksdb_options_t, a2: cint +) {.cdecl, importc: "rocksdb_options_set_wal_compression", dynlib: librocksdb.} + +proc rocksdb_options_get_wal_compression*( + opt: ptr rocksdb_options_t +): cint {.cdecl, importc: "rocksdb_options_get_wal_compression", dynlib: librocksdb.} + ## RateLimiter -proc rocksdb_ratelimiter_create*(rate_bytes_per_sec: int64; - refill_period_us: int64; fairness: int32): ptr rocksdb_ratelimiter_t {. - cdecl, importc: "rocksdb_ratelimiter_create", dynlib: librocksdb.} -proc rocksdb_ratelimiter_create_auto_tuned*(rate_bytes_per_sec: int64; - refill_period_us: int64; fairness: int32): ptr rocksdb_ratelimiter_t {.cdecl, - importc: "rocksdb_ratelimiter_create_auto_tuned", dynlib: librocksdb.} -proc rocksdb_ratelimiter_create_with_mode*(rate_bytes_per_sec: int64; - refill_period_us: int64; fairness: int32; mode: cint; auto_tuned: bool): ptr rocksdb_ratelimiter_t {. - cdecl, importc: "rocksdb_ratelimiter_create_with_mode", dynlib: librocksdb.} -proc rocksdb_ratelimiter_destroy*(a1: ptr rocksdb_ratelimiter_t) {.cdecl, - importc: "rocksdb_ratelimiter_destroy", dynlib: librocksdb.} +proc rocksdb_ratelimiter_create*( + rate_bytes_per_sec: int64, refill_period_us: int64, fairness: int32 +): ptr rocksdb_ratelimiter_t {. + cdecl, importc: "rocksdb_ratelimiter_create", dynlib: librocksdb +.} + +proc rocksdb_ratelimiter_create_auto_tuned*( + rate_bytes_per_sec: int64, refill_period_us: int64, fairness: int32 +): ptr rocksdb_ratelimiter_t {. + cdecl, importc: "rocksdb_ratelimiter_create_auto_tuned", dynlib: librocksdb +.} + +proc rocksdb_ratelimiter_create_with_mode*( + rate_bytes_per_sec: int64, + refill_period_us: int64, + fairness: int32, + mode: cint, + auto_tuned: bool, +): ptr rocksdb_ratelimiter_t {. + cdecl, importc: "rocksdb_ratelimiter_create_with_mode", dynlib: librocksdb +.} + +proc rocksdb_ratelimiter_destroy*( + a1: ptr rocksdb_ratelimiter_t +) {.cdecl, importc: "rocksdb_ratelimiter_destroy", dynlib: librocksdb.} + ## PerfContext const @@ -1844,557 +3402,1063 @@ const rocksdb_block_read_cpu_time* = 76 rocksdb_total_metric_count* = 79 -proc rocksdb_set_perf_level*(a1: cint) {.cdecl, importc: "rocksdb_set_perf_level", - dynlib: librocksdb.} -proc rocksdb_perfcontext_create*(): ptr rocksdb_perfcontext_t {.cdecl, - importc: "rocksdb_perfcontext_create", dynlib: librocksdb.} -proc rocksdb_perfcontext_reset*(context: ptr rocksdb_perfcontext_t) {.cdecl, - importc: "rocksdb_perfcontext_reset", dynlib: librocksdb.} -proc rocksdb_perfcontext_report*(context: ptr rocksdb_perfcontext_t; - exclude_zero_counters: uint8): cstring {.cdecl, - importc: "rocksdb_perfcontext_report", dynlib: librocksdb.} -proc rocksdb_perfcontext_metric*(context: ptr rocksdb_perfcontext_t; metric: cint): uint64 {. - cdecl, importc: "rocksdb_perfcontext_metric", dynlib: librocksdb.} -proc rocksdb_perfcontext_destroy*(context: ptr rocksdb_perfcontext_t) {.cdecl, - importc: "rocksdb_perfcontext_destroy", dynlib: librocksdb.} +proc rocksdb_set_perf_level*( + a1: cint +) {.cdecl, importc: "rocksdb_set_perf_level", dynlib: librocksdb.} + +proc rocksdb_perfcontext_create*(): ptr rocksdb_perfcontext_t {. + cdecl, importc: "rocksdb_perfcontext_create", dynlib: librocksdb +.} + +proc rocksdb_perfcontext_reset*( + context: ptr rocksdb_perfcontext_t +) {.cdecl, importc: "rocksdb_perfcontext_reset", dynlib: librocksdb.} + +proc rocksdb_perfcontext_report*( + context: ptr rocksdb_perfcontext_t, exclude_zero_counters: uint8 +): cstring {.cdecl, importc: "rocksdb_perfcontext_report", dynlib: librocksdb.} + +proc rocksdb_perfcontext_metric*( + context: ptr rocksdb_perfcontext_t, metric: cint +): uint64 {.cdecl, importc: "rocksdb_perfcontext_metric", dynlib: librocksdb.} + +proc rocksdb_perfcontext_destroy*( + context: ptr rocksdb_perfcontext_t +) {.cdecl, importc: "rocksdb_perfcontext_destroy", dynlib: librocksdb.} + ## Compaction Filter -proc rocksdb_compactionfilter_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; filter: proc ( - a1: pointer; level: cint; key: cstring; key_length: csize_t; - existing_value: cstring; value_length: csize_t; new_value: cstringArray; - new_value_length: ptr csize_t; value_changed: ptr uint8): uint8 {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_compactionfilter_t {. - cdecl, importc: "rocksdb_compactionfilter_create", dynlib: librocksdb.} +proc rocksdb_compactionfilter_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + filter: proc( + a1: pointer, + level: cint, + key: cstring, + key_length: csize_t, + existing_value: cstring, + value_length: csize_t, + new_value: cstringArray, + new_value_length: ptr csize_t, + value_changed: ptr uint8, + ): uint8 {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_compactionfilter_t {. + cdecl, importc: "rocksdb_compactionfilter_create", dynlib: librocksdb +.} + proc rocksdb_compactionfilter_set_ignore_snapshots*( - a1: ptr rocksdb_compactionfilter_t; a2: uint8) {.cdecl, - importc: "rocksdb_compactionfilter_set_ignore_snapshots", dynlib: librocksdb.} -proc rocksdb_compactionfilter_destroy*(a1: ptr rocksdb_compactionfilter_t) {.cdecl, - importc: "rocksdb_compactionfilter_destroy", dynlib: librocksdb.} + a1: ptr rocksdb_compactionfilter_t, a2: uint8 +) {. + cdecl, importc: "rocksdb_compactionfilter_set_ignore_snapshots", dynlib: librocksdb +.} + +proc rocksdb_compactionfilter_destroy*( + a1: ptr rocksdb_compactionfilter_t +) {.cdecl, importc: "rocksdb_compactionfilter_destroy", dynlib: librocksdb.} + ## Compaction Filter Context proc rocksdb_compactionfiltercontext_is_full_compaction*( - context: ptr rocksdb_compactionfiltercontext_t): uint8 {.cdecl, - importc: "rocksdb_compactionfiltercontext_is_full_compaction", - dynlib: librocksdb.} + context: ptr rocksdb_compactionfiltercontext_t +): uint8 {. + cdecl, + importc: "rocksdb_compactionfiltercontext_is_full_compaction", + dynlib: librocksdb +.} + proc rocksdb_compactionfiltercontext_is_manual_compaction*( - context: ptr rocksdb_compactionfiltercontext_t): uint8 {.cdecl, - importc: "rocksdb_compactionfiltercontext_is_manual_compaction", - dynlib: librocksdb.} + context: ptr rocksdb_compactionfiltercontext_t +): uint8 {. + cdecl, + importc: "rocksdb_compactionfiltercontext_is_manual_compaction", + dynlib: librocksdb +.} + ## Compaction Filter Factory -proc rocksdb_compactionfilterfactory_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; create_compaction_filter: proc ( - a1: pointer; context: ptr rocksdb_compactionfiltercontext_t): ptr rocksdb_compactionfilter_t {. - cdecl.}; name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_compactionfilterfactory_t {. - cdecl, importc: "rocksdb_compactionfilterfactory_create", dynlib: librocksdb.} +proc rocksdb_compactionfilterfactory_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + create_compaction_filter: proc( + a1: pointer, context: ptr rocksdb_compactionfiltercontext_t + ): ptr rocksdb_compactionfilter_t {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_compactionfilterfactory_t {. + cdecl, importc: "rocksdb_compactionfilterfactory_create", dynlib: librocksdb +.} + proc rocksdb_compactionfilterfactory_destroy*( - a1: ptr rocksdb_compactionfilterfactory_t) {.cdecl, - importc: "rocksdb_compactionfilterfactory_destroy", dynlib: librocksdb.} + a1: ptr rocksdb_compactionfilterfactory_t +) {.cdecl, importc: "rocksdb_compactionfilterfactory_destroy", dynlib: librocksdb.} + ## Comparator -proc rocksdb_comparator_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; compare: proc ( - a1: pointer; a: cstring; alen: csize_t; b: cstring; blen: csize_t): cint {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_comparator_t {. - cdecl, importc: "rocksdb_comparator_create", dynlib: librocksdb.} -proc rocksdb_comparator_destroy*(a1: ptr rocksdb_comparator_t) {.cdecl, - importc: "rocksdb_comparator_destroy", dynlib: librocksdb.} -proc rocksdb_comparator_with_ts_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; - compare: proc (a1: pointer; a: cstring; alen: csize_t; b: cstring; blen: csize_t): cint {. - cdecl.}; compare_ts: proc (a1: pointer; a_ts: cstring; a_tslen: csize_t; - b_ts: cstring; b_tslen: csize_t): cint {.cdecl.}; - compare_without_ts: proc (a1: pointer; a: cstring; alen: csize_t; a_has_ts: uint8; - b: cstring; blen: csize_t; b_has_ts: uint8): cint {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}; timestamp_size: csize_t): ptr rocksdb_comparator_t {. - cdecl, importc: "rocksdb_comparator_with_ts_create", dynlib: librocksdb.} +proc rocksdb_comparator_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + compare: proc(a1: pointer, a: cstring, alen: csize_t, b: cstring, blen: csize_t): cint {. + cdecl + .}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_comparator_t {. + cdecl, importc: "rocksdb_comparator_create", dynlib: librocksdb +.} + +proc rocksdb_comparator_destroy*( + a1: ptr rocksdb_comparator_t +) {.cdecl, importc: "rocksdb_comparator_destroy", dynlib: librocksdb.} + +proc rocksdb_comparator_with_ts_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + compare: proc(a1: pointer, a: cstring, alen: csize_t, b: cstring, blen: csize_t): cint {. + cdecl + .}, + compare_ts: proc( + a1: pointer, a_ts: cstring, a_tslen: csize_t, b_ts: cstring, b_tslen: csize_t + ): cint {.cdecl.}, + compare_without_ts: proc( + a1: pointer, + a: cstring, + alen: csize_t, + a_has_ts: uint8, + b: cstring, + blen: csize_t, + b_has_ts: uint8, + ): cint {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, + timestamp_size: csize_t, +): ptr rocksdb_comparator_t {. + cdecl, importc: "rocksdb_comparator_with_ts_create", dynlib: librocksdb +.} + ## Filter policy -proc rocksdb_filterpolicy_destroy*(a1: ptr rocksdb_filterpolicy_t) {.cdecl, - importc: "rocksdb_filterpolicy_destroy", dynlib: librocksdb.} -proc rocksdb_filterpolicy_create_bloom*(bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_bloom", dynlib: librocksdb.} -proc rocksdb_filterpolicy_create_bloom_full*(bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_bloom_full", dynlib: librocksdb.} -proc rocksdb_filterpolicy_create_ribbon*(bloom_equivalent_bits_per_key: cdouble): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_ribbon", dynlib: librocksdb.} +proc rocksdb_filterpolicy_destroy*( + a1: ptr rocksdb_filterpolicy_t +) {.cdecl, importc: "rocksdb_filterpolicy_destroy", dynlib: librocksdb.} + +proc rocksdb_filterpolicy_create_bloom*( + bits_per_key: cdouble +): ptr rocksdb_filterpolicy_t {. + cdecl, importc: "rocksdb_filterpolicy_create_bloom", dynlib: librocksdb +.} + +proc rocksdb_filterpolicy_create_bloom_full*( + bits_per_key: cdouble +): ptr rocksdb_filterpolicy_t {. + cdecl, importc: "rocksdb_filterpolicy_create_bloom_full", dynlib: librocksdb +.} + +proc rocksdb_filterpolicy_create_ribbon*( + bloom_equivalent_bits_per_key: cdouble +): ptr rocksdb_filterpolicy_t {. + cdecl, importc: "rocksdb_filterpolicy_create_ribbon", dynlib: librocksdb +.} + proc rocksdb_filterpolicy_create_ribbon_hybrid*( - bloom_equivalent_bits_per_key: cdouble; bloom_before_level: cint): ptr rocksdb_filterpolicy_t {. - cdecl, importc: "rocksdb_filterpolicy_create_ribbon_hybrid", dynlib: librocksdb.} + bloom_equivalent_bits_per_key: cdouble, bloom_before_level: cint +): ptr rocksdb_filterpolicy_t {. + cdecl, importc: "rocksdb_filterpolicy_create_ribbon_hybrid", dynlib: librocksdb +.} + ## Merge Operator -proc rocksdb_mergeoperator_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; - full_merge: proc (a1: pointer; key: cstring; key_length: csize_t; - existing_value: cstring; existing_value_length: csize_t; - operands_list: cstringArray; - operands_list_length: ptr csize_t; num_operands: cint; - success: ptr uint8; new_value_length: ptr csize_t): cstring {.cdecl.}; - partial_merge: proc (a1: pointer; key: cstring; key_length: csize_t; - operands_list: cstringArray; - operands_list_length: ptr csize_t; num_operands: cint; - success: ptr uint8; new_value_length: ptr csize_t): cstring {. - cdecl.}; delete_value: proc (a1: pointer; value: cstring; value_length: csize_t) {. - cdecl.}; name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_mergeoperator_t {. - cdecl, importc: "rocksdb_mergeoperator_create", dynlib: librocksdb.} -proc rocksdb_mergeoperator_destroy*(a1: ptr rocksdb_mergeoperator_t) {.cdecl, - importc: "rocksdb_mergeoperator_destroy", dynlib: librocksdb.} +proc rocksdb_mergeoperator_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + full_merge: proc( + a1: pointer, + key: cstring, + key_length: csize_t, + existing_value: cstring, + existing_value_length: csize_t, + operands_list: cstringArray, + operands_list_length: ptr csize_t, + num_operands: cint, + success: ptr uint8, + new_value_length: ptr csize_t, + ): cstring {.cdecl.}, + partial_merge: proc( + a1: pointer, + key: cstring, + key_length: csize_t, + operands_list: cstringArray, + operands_list_length: ptr csize_t, + num_operands: cint, + success: ptr uint8, + new_value_length: ptr csize_t, + ): cstring {.cdecl.}, + delete_value: proc(a1: pointer, value: cstring, value_length: csize_t) {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_mergeoperator_t {. + cdecl, importc: "rocksdb_mergeoperator_create", dynlib: librocksdb +.} + +proc rocksdb_mergeoperator_destroy*( + a1: ptr rocksdb_mergeoperator_t +) {.cdecl, importc: "rocksdb_mergeoperator_destroy", dynlib: librocksdb.} + ## Read options -proc rocksdb_readoptions_create*(): ptr rocksdb_readoptions_t {.cdecl, - importc: "rocksdb_readoptions_create", dynlib: librocksdb.} -proc rocksdb_readoptions_destroy*(a1: ptr rocksdb_readoptions_t) {.cdecl, - importc: "rocksdb_readoptions_destroy", dynlib: librocksdb.} -proc rocksdb_readoptions_set_verify_checksums*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl, importc: "rocksdb_readoptions_set_verify_checksums", - dynlib: librocksdb.} -proc rocksdb_readoptions_get_verify_checksums*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_verify_checksums", dynlib: librocksdb.} -proc rocksdb_readoptions_set_fill_cache*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_readoptions_set_fill_cache", dynlib: librocksdb.} -proc rocksdb_readoptions_get_fill_cache*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_fill_cache", dynlib: librocksdb.} -proc rocksdb_readoptions_set_snapshot*(a1: ptr rocksdb_readoptions_t; - a2: ptr rocksdb_snapshot_t) {.cdecl, - importc: "rocksdb_readoptions_set_snapshot", dynlib: librocksdb.} -proc rocksdb_readoptions_set_iterate_upper_bound*(a1: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t) {.cdecl, importc: "rocksdb_readoptions_set_iterate_upper_bound", - dynlib: librocksdb.} -proc rocksdb_readoptions_set_iterate_lower_bound*(a1: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t) {.cdecl, importc: "rocksdb_readoptions_set_iterate_lower_bound", - dynlib: librocksdb.} -proc rocksdb_readoptions_set_read_tier*(a1: ptr rocksdb_readoptions_t; a2: cint) {. - cdecl, importc: "rocksdb_readoptions_set_read_tier", dynlib: librocksdb.} -proc rocksdb_readoptions_get_read_tier*(a1: ptr rocksdb_readoptions_t): cint {.cdecl, - importc: "rocksdb_readoptions_get_read_tier", dynlib: librocksdb.} -proc rocksdb_readoptions_set_tailing*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_readoptions_set_tailing", dynlib: librocksdb.} -proc rocksdb_readoptions_get_tailing*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl, - importc: "rocksdb_readoptions_get_tailing", dynlib: librocksdb.} +proc rocksdb_readoptions_create*(): ptr rocksdb_readoptions_t {. + cdecl, importc: "rocksdb_readoptions_create", dynlib: librocksdb +.} + +proc rocksdb_readoptions_destroy*( + a1: ptr rocksdb_readoptions_t +) {.cdecl, importc: "rocksdb_readoptions_destroy", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_verify_checksums*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_verify_checksums", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_verify_checksums*( + a1: ptr rocksdb_readoptions_t +): uint8 {. + cdecl, importc: "rocksdb_readoptions_get_verify_checksums", dynlib: librocksdb +.} + +proc rocksdb_readoptions_set_fill_cache*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_fill_cache", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_fill_cache*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl, importc: "rocksdb_readoptions_get_fill_cache", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_snapshot*( + a1: ptr rocksdb_readoptions_t, a2: ptr rocksdb_snapshot_t +) {.cdecl, importc: "rocksdb_readoptions_set_snapshot", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_iterate_upper_bound*( + a1: ptr rocksdb_readoptions_t, key: cstring, keylen: csize_t +) {.cdecl, importc: "rocksdb_readoptions_set_iterate_upper_bound", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_iterate_lower_bound*( + a1: ptr rocksdb_readoptions_t, key: cstring, keylen: csize_t +) {.cdecl, importc: "rocksdb_readoptions_set_iterate_lower_bound", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_read_tier*( + a1: ptr rocksdb_readoptions_t, a2: cint +) {.cdecl, importc: "rocksdb_readoptions_set_read_tier", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_read_tier*( + a1: ptr rocksdb_readoptions_t +): cint {.cdecl, importc: "rocksdb_readoptions_get_read_tier", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_tailing*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_tailing", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_tailing*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl, importc: "rocksdb_readoptions_get_tailing", dynlib: librocksdb.} + ## The functionality that this option controlled has been removed. -proc rocksdb_readoptions_set_managed*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_readoptions_set_managed", dynlib: librocksdb.} -proc rocksdb_readoptions_set_readahead_size*(a1: ptr rocksdb_readoptions_t; - a2: csize_t) {.cdecl, importc: "rocksdb_readoptions_set_readahead_size", - dynlib: librocksdb.} -proc rocksdb_readoptions_get_readahead_size*(a1: ptr rocksdb_readoptions_t): csize_t {. - cdecl, importc: "rocksdb_readoptions_get_readahead_size", dynlib: librocksdb.} -proc rocksdb_readoptions_set_prefix_same_as_start*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl, importc: "rocksdb_readoptions_set_prefix_same_as_start", - dynlib: librocksdb.} -proc rocksdb_readoptions_get_prefix_same_as_start*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_prefix_same_as_start", - dynlib: librocksdb.} -proc rocksdb_readoptions_set_pin_data*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_readoptions_set_pin_data", dynlib: librocksdb.} -proc rocksdb_readoptions_get_pin_data*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl, - importc: "rocksdb_readoptions_get_pin_data", dynlib: librocksdb.} -proc rocksdb_readoptions_set_total_order_seek*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl, importc: "rocksdb_readoptions_set_total_order_seek", - dynlib: librocksdb.} -proc rocksdb_readoptions_get_total_order_seek*(a1: ptr rocksdb_readoptions_t): uint8 {. - cdecl, importc: "rocksdb_readoptions_get_total_order_seek", dynlib: librocksdb.} +proc rocksdb_readoptions_set_managed*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_managed", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_readahead_size*( + a1: ptr rocksdb_readoptions_t, a2: csize_t +) {.cdecl, importc: "rocksdb_readoptions_set_readahead_size", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_readahead_size*( + a1: ptr rocksdb_readoptions_t +): csize_t {. + cdecl, importc: "rocksdb_readoptions_get_readahead_size", dynlib: librocksdb +.} + +proc rocksdb_readoptions_set_prefix_same_as_start*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_prefix_same_as_start", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_prefix_same_as_start*( + a1: ptr rocksdb_readoptions_t +): uint8 {. + cdecl, importc: "rocksdb_readoptions_get_prefix_same_as_start", dynlib: librocksdb +.} + +proc rocksdb_readoptions_set_pin_data*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_pin_data", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_pin_data*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl, importc: "rocksdb_readoptions_get_pin_data", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_total_order_seek*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_total_order_seek", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_total_order_seek*( + a1: ptr rocksdb_readoptions_t +): uint8 {. + cdecl, importc: "rocksdb_readoptions_get_total_order_seek", dynlib: librocksdb +.} + proc rocksdb_readoptions_set_max_skippable_internal_keys*( - a1: ptr rocksdb_readoptions_t; a2: uint64) {.cdecl, - importc: "rocksdb_readoptions_set_max_skippable_internal_keys", - dynlib: librocksdb.} + a1: ptr rocksdb_readoptions_t, a2: uint64 +) {. + cdecl, + importc: "rocksdb_readoptions_set_max_skippable_internal_keys", + dynlib: librocksdb +.} + proc rocksdb_readoptions_get_max_skippable_internal_keys*( - a1: ptr rocksdb_readoptions_t): uint64 {.cdecl, - importc: "rocksdb_readoptions_get_max_skippable_internal_keys", - dynlib: librocksdb.} + a1: ptr rocksdb_readoptions_t +): uint64 {. + cdecl, + importc: "rocksdb_readoptions_get_max_skippable_internal_keys", + dynlib: librocksdb +.} + proc rocksdb_readoptions_set_background_purge_on_iterator_cleanup*( - a1: ptr rocksdb_readoptions_t; a2: uint8) {.cdecl, - importc: "rocksdb_readoptions_set_background_purge_on_iterator_cleanup", - dynlib: librocksdb.} + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_readoptions_set_background_purge_on_iterator_cleanup", + dynlib: librocksdb +.} + proc rocksdb_readoptions_get_background_purge_on_iterator_cleanup*( - a1: ptr rocksdb_readoptions_t): uint8 {.cdecl, importc: "rocksdb_readoptions_get_background_purge_on_iterator_cleanup", - dynlib: librocksdb.} + a1: ptr rocksdb_readoptions_t +): uint8 {. + cdecl, + importc: "rocksdb_readoptions_get_background_purge_on_iterator_cleanup", + dynlib: librocksdb +.} + proc rocksdb_readoptions_set_ignore_range_deletions*( - a1: ptr rocksdb_readoptions_t; a2: uint8) {.cdecl, - importc: "rocksdb_readoptions_set_ignore_range_deletions", dynlib: librocksdb.} + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {. + cdecl, importc: "rocksdb_readoptions_set_ignore_range_deletions", dynlib: librocksdb +.} + proc rocksdb_readoptions_get_ignore_range_deletions*( - a1: ptr rocksdb_readoptions_t): uint8 {.cdecl, importc: "rocksdb_readoptions_get_ignore_range_deletions", - dynlib: librocksdb.} -proc rocksdb_readoptions_set_deadline*(a1: ptr rocksdb_readoptions_t; - microseconds: uint64) {.cdecl, - importc: "rocksdb_readoptions_set_deadline", dynlib: librocksdb.} -proc rocksdb_readoptions_get_deadline*(a1: ptr rocksdb_readoptions_t): uint64 {. - cdecl, importc: "rocksdb_readoptions_get_deadline", dynlib: librocksdb.} -proc rocksdb_readoptions_set_io_timeout*(a1: ptr rocksdb_readoptions_t; - microseconds: uint64) {.cdecl, - importc: "rocksdb_readoptions_set_io_timeout", dynlib: librocksdb.} -proc rocksdb_readoptions_get_io_timeout*(a1: ptr rocksdb_readoptions_t): uint64 {. - cdecl, importc: "rocksdb_readoptions_get_io_timeout", dynlib: librocksdb.} -proc rocksdb_readoptions_set_async_io*(a1: ptr rocksdb_readoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_readoptions_set_async_io", dynlib: librocksdb.} -proc rocksdb_readoptions_get_async_io*(a1: ptr rocksdb_readoptions_t): uint8 {.cdecl, - importc: "rocksdb_readoptions_get_async_io", dynlib: librocksdb.} -proc rocksdb_readoptions_set_timestamp*(a1: ptr rocksdb_readoptions_t; ts: cstring; - tslen: csize_t) {.cdecl, - importc: "rocksdb_readoptions_set_timestamp", dynlib: librocksdb.} -proc rocksdb_readoptions_set_iter_start_ts*(a1: ptr rocksdb_readoptions_t; - ts: cstring; tslen: csize_t) {.cdecl, importc: "rocksdb_readoptions_set_iter_start_ts", - dynlib: librocksdb.} -proc rocksdb_readoptions_set_auto_readahead_size*(a1: ptr rocksdb_readoptions_t; - a2: uint8) {.cdecl, importc: "rocksdb_readoptions_set_auto_readahead_size", - dynlib: librocksdb.} + a1: ptr rocksdb_readoptions_t +): uint8 {. + cdecl, importc: "rocksdb_readoptions_get_ignore_range_deletions", dynlib: librocksdb +.} + +proc rocksdb_readoptions_set_deadline*( + a1: ptr rocksdb_readoptions_t, microseconds: uint64 +) {.cdecl, importc: "rocksdb_readoptions_set_deadline", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_deadline*( + a1: ptr rocksdb_readoptions_t +): uint64 {.cdecl, importc: "rocksdb_readoptions_get_deadline", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_io_timeout*( + a1: ptr rocksdb_readoptions_t, microseconds: uint64 +) {.cdecl, importc: "rocksdb_readoptions_set_io_timeout", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_io_timeout*( + a1: ptr rocksdb_readoptions_t +): uint64 {.cdecl, importc: "rocksdb_readoptions_get_io_timeout", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_async_io*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_async_io", dynlib: librocksdb.} + +proc rocksdb_readoptions_get_async_io*( + a1: ptr rocksdb_readoptions_t +): uint8 {.cdecl, importc: "rocksdb_readoptions_get_async_io", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_timestamp*( + a1: ptr rocksdb_readoptions_t, ts: cstring, tslen: csize_t +) {.cdecl, importc: "rocksdb_readoptions_set_timestamp", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_iter_start_ts*( + a1: ptr rocksdb_readoptions_t, ts: cstring, tslen: csize_t +) {.cdecl, importc: "rocksdb_readoptions_set_iter_start_ts", dynlib: librocksdb.} + +proc rocksdb_readoptions_set_auto_readahead_size*( + a1: ptr rocksdb_readoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_readoptions_set_auto_readahead_size", dynlib: librocksdb.} + ## Write options -proc rocksdb_writeoptions_create*(): ptr rocksdb_writeoptions_t {.cdecl, - importc: "rocksdb_writeoptions_create", dynlib: librocksdb.} -proc rocksdb_writeoptions_destroy*(a1: ptr rocksdb_writeoptions_t) {.cdecl, - importc: "rocksdb_writeoptions_destroy", dynlib: librocksdb.} -proc rocksdb_writeoptions_set_sync*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_writeoptions_set_sync", dynlib: librocksdb.} -proc rocksdb_writeoptions_get_sync*(a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl, - importc: "rocksdb_writeoptions_get_sync", dynlib: librocksdb.} -proc rocksdb_writeoptions_disable_WAL*(opt: ptr rocksdb_writeoptions_t; - disable: cint) {.cdecl, - importc: "rocksdb_writeoptions_disable_WAL", dynlib: librocksdb.} -proc rocksdb_writeoptions_get_disable_WAL*(opt: ptr rocksdb_writeoptions_t): uint8 {. - cdecl, importc: "rocksdb_writeoptions_get_disable_WAL", dynlib: librocksdb.} +proc rocksdb_writeoptions_create*(): ptr rocksdb_writeoptions_t {. + cdecl, importc: "rocksdb_writeoptions_create", dynlib: librocksdb +.} + +proc rocksdb_writeoptions_destroy*( + a1: ptr rocksdb_writeoptions_t +) {.cdecl, importc: "rocksdb_writeoptions_destroy", dynlib: librocksdb.} + +proc rocksdb_writeoptions_set_sync*( + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_writeoptions_set_sync", dynlib: librocksdb.} + +proc rocksdb_writeoptions_get_sync*( + a1: ptr rocksdb_writeoptions_t +): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_sync", dynlib: librocksdb.} + +proc rocksdb_writeoptions_disable_WAL*( + opt: ptr rocksdb_writeoptions_t, disable: cint +) {.cdecl, importc: "rocksdb_writeoptions_disable_WAL", dynlib: librocksdb.} + +proc rocksdb_writeoptions_get_disable_WAL*( + opt: ptr rocksdb_writeoptions_t +): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_disable_WAL", dynlib: librocksdb.} + proc rocksdb_writeoptions_set_ignore_missing_column_families*( - a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl, - importc: "rocksdb_writeoptions_set_ignore_missing_column_families", - dynlib: librocksdb.} + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_writeoptions_set_ignore_missing_column_families", + dynlib: librocksdb +.} + proc rocksdb_writeoptions_get_ignore_missing_column_families*( - a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl, - importc: "rocksdb_writeoptions_get_ignore_missing_column_families", - dynlib: librocksdb.} -proc rocksdb_writeoptions_set_no_slowdown*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_writeoptions_set_no_slowdown", dynlib: librocksdb.} -proc rocksdb_writeoptions_get_no_slowdown*(a1: ptr rocksdb_writeoptions_t): uint8 {. - cdecl, importc: "rocksdb_writeoptions_get_no_slowdown", dynlib: librocksdb.} -proc rocksdb_writeoptions_set_low_pri*(a1: ptr rocksdb_writeoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_writeoptions_set_low_pri", dynlib: librocksdb.} -proc rocksdb_writeoptions_get_low_pri*(a1: ptr rocksdb_writeoptions_t): uint8 {. - cdecl, importc: "rocksdb_writeoptions_get_low_pri", dynlib: librocksdb.} + a1: ptr rocksdb_writeoptions_t +): uint8 {. + cdecl, + importc: "rocksdb_writeoptions_get_ignore_missing_column_families", + dynlib: librocksdb +.} + +proc rocksdb_writeoptions_set_no_slowdown*( + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_writeoptions_set_no_slowdown", dynlib: librocksdb.} + +proc rocksdb_writeoptions_get_no_slowdown*( + a1: ptr rocksdb_writeoptions_t +): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_no_slowdown", dynlib: librocksdb.} + +proc rocksdb_writeoptions_set_low_pri*( + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_writeoptions_set_low_pri", dynlib: librocksdb.} + +proc rocksdb_writeoptions_get_low_pri*( + a1: ptr rocksdb_writeoptions_t +): uint8 {.cdecl, importc: "rocksdb_writeoptions_get_low_pri", dynlib: librocksdb.} + proc rocksdb_writeoptions_set_memtable_insert_hint_per_batch*( - a1: ptr rocksdb_writeoptions_t; a2: uint8) {.cdecl, - importc: "rocksdb_writeoptions_set_memtable_insert_hint_per_batch", - dynlib: librocksdb.} + a1: ptr rocksdb_writeoptions_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_writeoptions_set_memtable_insert_hint_per_batch", + dynlib: librocksdb +.} + proc rocksdb_writeoptions_get_memtable_insert_hint_per_batch*( - a1: ptr rocksdb_writeoptions_t): uint8 {.cdecl, - importc: "rocksdb_writeoptions_get_memtable_insert_hint_per_batch", - dynlib: librocksdb.} + a1: ptr rocksdb_writeoptions_t +): uint8 {. + cdecl, + importc: "rocksdb_writeoptions_get_memtable_insert_hint_per_batch", + dynlib: librocksdb +.} + ## Compact range options -proc rocksdb_compactoptions_create*(): ptr rocksdb_compactoptions_t {.cdecl, - importc: "rocksdb_compactoptions_create", dynlib: librocksdb.} -proc rocksdb_compactoptions_destroy*(a1: ptr rocksdb_compactoptions_t) {.cdecl, - importc: "rocksdb_compactoptions_destroy", dynlib: librocksdb.} +proc rocksdb_compactoptions_create*(): ptr rocksdb_compactoptions_t {. + cdecl, importc: "rocksdb_compactoptions_create", dynlib: librocksdb +.} + +proc rocksdb_compactoptions_destroy*( + a1: ptr rocksdb_compactoptions_t +) {.cdecl, importc: "rocksdb_compactoptions_destroy", dynlib: librocksdb.} + proc rocksdb_compactoptions_set_exclusive_manual_compaction*( - a1: ptr rocksdb_compactoptions_t; a2: uint8) {.cdecl, - importc: "rocksdb_compactoptions_set_exclusive_manual_compaction", - dynlib: librocksdb.} + a1: ptr rocksdb_compactoptions_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_compactoptions_set_exclusive_manual_compaction", + dynlib: librocksdb +.} + proc rocksdb_compactoptions_get_exclusive_manual_compaction*( - a1: ptr rocksdb_compactoptions_t): uint8 {.cdecl, - importc: "rocksdb_compactoptions_get_exclusive_manual_compaction", - dynlib: librocksdb.} + a1: ptr rocksdb_compactoptions_t +): uint8 {. + cdecl, + importc: "rocksdb_compactoptions_get_exclusive_manual_compaction", + dynlib: librocksdb +.} + proc rocksdb_compactoptions_set_bottommost_level_compaction*( - a1: ptr rocksdb_compactoptions_t; a2: uint8) {.cdecl, - importc: "rocksdb_compactoptions_set_bottommost_level_compaction", - dynlib: librocksdb.} + a1: ptr rocksdb_compactoptions_t, a2: uint8 +) {. + cdecl, + importc: "rocksdb_compactoptions_set_bottommost_level_compaction", + dynlib: librocksdb +.} + proc rocksdb_compactoptions_get_bottommost_level_compaction*( - a1: ptr rocksdb_compactoptions_t): uint8 {.cdecl, - importc: "rocksdb_compactoptions_get_bottommost_level_compaction", - dynlib: librocksdb.} -proc rocksdb_compactoptions_set_change_level*(a1: ptr rocksdb_compactoptions_t; - a2: uint8) {.cdecl, importc: "rocksdb_compactoptions_set_change_level", - dynlib: librocksdb.} -proc rocksdb_compactoptions_get_change_level*(a1: ptr rocksdb_compactoptions_t): uint8 {. - cdecl, importc: "rocksdb_compactoptions_get_change_level", dynlib: librocksdb.} -proc rocksdb_compactoptions_set_target_level*(a1: ptr rocksdb_compactoptions_t; - a2: cint) {.cdecl, importc: "rocksdb_compactoptions_set_target_level", - dynlib: librocksdb.} -proc rocksdb_compactoptions_get_target_level*(a1: ptr rocksdb_compactoptions_t): cint {. - cdecl, importc: "rocksdb_compactoptions_get_target_level", dynlib: librocksdb.} + a1: ptr rocksdb_compactoptions_t +): uint8 {. + cdecl, + importc: "rocksdb_compactoptions_get_bottommost_level_compaction", + dynlib: librocksdb +.} + +proc rocksdb_compactoptions_set_change_level*( + a1: ptr rocksdb_compactoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_compactoptions_set_change_level", dynlib: librocksdb.} + +proc rocksdb_compactoptions_get_change_level*( + a1: ptr rocksdb_compactoptions_t +): uint8 {. + cdecl, importc: "rocksdb_compactoptions_get_change_level", dynlib: librocksdb +.} + +proc rocksdb_compactoptions_set_target_level*( + a1: ptr rocksdb_compactoptions_t, a2: cint +) {.cdecl, importc: "rocksdb_compactoptions_set_target_level", dynlib: librocksdb.} + +proc rocksdb_compactoptions_get_target_level*( + a1: ptr rocksdb_compactoptions_t +): cint {. + cdecl, importc: "rocksdb_compactoptions_get_target_level", dynlib: librocksdb +.} + proc rocksdb_compactoptions_set_full_history_ts_low*( - a1: ptr rocksdb_compactoptions_t; ts: cstring; tslen: csize_t) {.cdecl, - importc: "rocksdb_compactoptions_set_full_history_ts_low", dynlib: librocksdb.} + a1: ptr rocksdb_compactoptions_t, ts: cstring, tslen: csize_t +) {. + cdecl, importc: "rocksdb_compactoptions_set_full_history_ts_low", dynlib: librocksdb +.} + ## Flush options -proc rocksdb_flushoptions_create*(): ptr rocksdb_flushoptions_t {.cdecl, - importc: "rocksdb_flushoptions_create", dynlib: librocksdb.} -proc rocksdb_flushoptions_destroy*(a1: ptr rocksdb_flushoptions_t) {.cdecl, - importc: "rocksdb_flushoptions_destroy", dynlib: librocksdb.} -proc rocksdb_flushoptions_set_wait*(a1: ptr rocksdb_flushoptions_t; a2: uint8) {. - cdecl, importc: "rocksdb_flushoptions_set_wait", dynlib: librocksdb.} -proc rocksdb_flushoptions_get_wait*(a1: ptr rocksdb_flushoptions_t): uint8 {.cdecl, - importc: "rocksdb_flushoptions_get_wait", dynlib: librocksdb.} +proc rocksdb_flushoptions_create*(): ptr rocksdb_flushoptions_t {. + cdecl, importc: "rocksdb_flushoptions_create", dynlib: librocksdb +.} + +proc rocksdb_flushoptions_destroy*( + a1: ptr rocksdb_flushoptions_t +) {.cdecl, importc: "rocksdb_flushoptions_destroy", dynlib: librocksdb.} + +proc rocksdb_flushoptions_set_wait*( + a1: ptr rocksdb_flushoptions_t, a2: uint8 +) {.cdecl, importc: "rocksdb_flushoptions_set_wait", dynlib: librocksdb.} + +proc rocksdb_flushoptions_get_wait*( + a1: ptr rocksdb_flushoptions_t +): uint8 {.cdecl, importc: "rocksdb_flushoptions_get_wait", dynlib: librocksdb.} + ## Memory allocator -proc rocksdb_jemalloc_nodump_allocator_create*(errptr: cstringArray): ptr rocksdb_memory_allocator_t {. - cdecl, importc: "rocksdb_jemalloc_nodump_allocator_create", dynlib: librocksdb.} -proc rocksdb_memory_allocator_destroy*(a1: ptr rocksdb_memory_allocator_t) {.cdecl, - importc: "rocksdb_memory_allocator_destroy", dynlib: librocksdb.} +proc rocksdb_jemalloc_nodump_allocator_create*( + errptr: cstringArray +): ptr rocksdb_memory_allocator_t {. + cdecl, importc: "rocksdb_jemalloc_nodump_allocator_create", dynlib: librocksdb +.} + +proc rocksdb_memory_allocator_destroy*( + a1: ptr rocksdb_memory_allocator_t +) {.cdecl, importc: "rocksdb_memory_allocator_destroy", dynlib: librocksdb.} + ## Cache -proc rocksdb_lru_cache_options_create*(): ptr rocksdb_lru_cache_options_t {.cdecl, - importc: "rocksdb_lru_cache_options_create", dynlib: librocksdb.} -proc rocksdb_lru_cache_options_destroy*(a1: ptr rocksdb_lru_cache_options_t) {. - cdecl, importc: "rocksdb_lru_cache_options_destroy", dynlib: librocksdb.} -proc rocksdb_lru_cache_options_set_capacity*(a1: ptr rocksdb_lru_cache_options_t; - a2: csize_t) {.cdecl, importc: "rocksdb_lru_cache_options_set_capacity", - dynlib: librocksdb.} +proc rocksdb_lru_cache_options_create*(): ptr rocksdb_lru_cache_options_t {. + cdecl, importc: "rocksdb_lru_cache_options_create", dynlib: librocksdb +.} + +proc rocksdb_lru_cache_options_destroy*( + a1: ptr rocksdb_lru_cache_options_t +) {.cdecl, importc: "rocksdb_lru_cache_options_destroy", dynlib: librocksdb.} + +proc rocksdb_lru_cache_options_set_capacity*( + a1: ptr rocksdb_lru_cache_options_t, a2: csize_t +) {.cdecl, importc: "rocksdb_lru_cache_options_set_capacity", dynlib: librocksdb.} + proc rocksdb_lru_cache_options_set_num_shard_bits*( - a1: ptr rocksdb_lru_cache_options_t; a2: cint) {.cdecl, - importc: "rocksdb_lru_cache_options_set_num_shard_bits", dynlib: librocksdb.} + a1: ptr rocksdb_lru_cache_options_t, a2: cint +) {.cdecl, importc: "rocksdb_lru_cache_options_set_num_shard_bits", dynlib: librocksdb.} + proc rocksdb_lru_cache_options_set_memory_allocator*( - a1: ptr rocksdb_lru_cache_options_t; a2: ptr rocksdb_memory_allocator_t) {.cdecl, - importc: "rocksdb_lru_cache_options_set_memory_allocator", dynlib: librocksdb.} -proc rocksdb_cache_create_lru*(capacity: csize_t): ptr rocksdb_cache_t {.cdecl, - importc: "rocksdb_cache_create_lru", dynlib: librocksdb.} -proc rocksdb_cache_create_lru_with_strict_capacity_limit*(capacity: csize_t): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_lru_with_strict_capacity_limit", - dynlib: librocksdb.} -proc rocksdb_cache_create_lru_opts*(a1: ptr rocksdb_lru_cache_options_t): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_lru_opts", dynlib: librocksdb.} -proc rocksdb_cache_destroy*(cache: ptr rocksdb_cache_t) {.cdecl, - importc: "rocksdb_cache_destroy", dynlib: librocksdb.} -proc rocksdb_cache_disown_data*(cache: ptr rocksdb_cache_t) {.cdecl, - importc: "rocksdb_cache_disown_data", dynlib: librocksdb.} -proc rocksdb_cache_set_capacity*(cache: ptr rocksdb_cache_t; capacity: csize_t) {. - cdecl, importc: "rocksdb_cache_set_capacity", dynlib: librocksdb.} -proc rocksdb_cache_get_capacity*(cache: ptr rocksdb_cache_t): csize_t {.cdecl, - importc: "rocksdb_cache_get_capacity", dynlib: librocksdb.} -proc rocksdb_cache_get_usage*(cache: ptr rocksdb_cache_t): csize_t {.cdecl, - importc: "rocksdb_cache_get_usage", dynlib: librocksdb.} -proc rocksdb_cache_get_pinned_usage*(cache: ptr rocksdb_cache_t): csize_t {.cdecl, - importc: "rocksdb_cache_get_pinned_usage", dynlib: librocksdb.} -proc rocksdb_cache_get_table_address_count*(cache: ptr rocksdb_cache_t): csize_t {. - cdecl, importc: "rocksdb_cache_get_table_address_count", dynlib: librocksdb.} -proc rocksdb_cache_get_occupancy_count*(cache: ptr rocksdb_cache_t): csize_t {.cdecl, - importc: "rocksdb_cache_get_occupancy_count", dynlib: librocksdb.} + a1: ptr rocksdb_lru_cache_options_t, a2: ptr rocksdb_memory_allocator_t +) {. + cdecl, importc: "rocksdb_lru_cache_options_set_memory_allocator", dynlib: librocksdb +.} + +proc rocksdb_cache_create_lru*( + capacity: csize_t +): ptr rocksdb_cache_t {. + cdecl, importc: "rocksdb_cache_create_lru", dynlib: librocksdb +.} + +proc rocksdb_cache_create_lru_with_strict_capacity_limit*( + capacity: csize_t +): ptr rocksdb_cache_t {. + cdecl, + importc: "rocksdb_cache_create_lru_with_strict_capacity_limit", + dynlib: librocksdb +.} + +proc rocksdb_cache_create_lru_opts*( + a1: ptr rocksdb_lru_cache_options_t +): ptr rocksdb_cache_t {. + cdecl, importc: "rocksdb_cache_create_lru_opts", dynlib: librocksdb +.} + +proc rocksdb_cache_destroy*( + cache: ptr rocksdb_cache_t +) {.cdecl, importc: "rocksdb_cache_destroy", dynlib: librocksdb.} + +proc rocksdb_cache_disown_data*( + cache: ptr rocksdb_cache_t +) {.cdecl, importc: "rocksdb_cache_disown_data", dynlib: librocksdb.} + +proc rocksdb_cache_set_capacity*( + cache: ptr rocksdb_cache_t, capacity: csize_t +) {.cdecl, importc: "rocksdb_cache_set_capacity", dynlib: librocksdb.} + +proc rocksdb_cache_get_capacity*( + cache: ptr rocksdb_cache_t +): csize_t {.cdecl, importc: "rocksdb_cache_get_capacity", dynlib: librocksdb.} + +proc rocksdb_cache_get_usage*( + cache: ptr rocksdb_cache_t +): csize_t {.cdecl, importc: "rocksdb_cache_get_usage", dynlib: librocksdb.} + +proc rocksdb_cache_get_pinned_usage*( + cache: ptr rocksdb_cache_t +): csize_t {.cdecl, importc: "rocksdb_cache_get_pinned_usage", dynlib: librocksdb.} + +proc rocksdb_cache_get_table_address_count*( + cache: ptr rocksdb_cache_t +): csize_t {. + cdecl, importc: "rocksdb_cache_get_table_address_count", dynlib: librocksdb +.} + +proc rocksdb_cache_get_occupancy_count*( + cache: ptr rocksdb_cache_t +): csize_t {.cdecl, importc: "rocksdb_cache_get_occupancy_count", dynlib: librocksdb.} + ## WriteBufferManager -proc rocksdb_write_buffer_manager_create*(buffer_size: csize_t; allow_stall: bool): ptr rocksdb_write_buffer_manager_t {. - cdecl, importc: "rocksdb_write_buffer_manager_create", dynlib: librocksdb.} -proc rocksdb_write_buffer_manager_create_with_cache*(buffer_size: csize_t; - cache: ptr rocksdb_cache_t; allow_stall: bool): ptr rocksdb_write_buffer_manager_t {. - cdecl, importc: "rocksdb_write_buffer_manager_create_with_cache", - dynlib: librocksdb.} +proc rocksdb_write_buffer_manager_create*( + buffer_size: csize_t, allow_stall: bool +): ptr rocksdb_write_buffer_manager_t {. + cdecl, importc: "rocksdb_write_buffer_manager_create", dynlib: librocksdb +.} + +proc rocksdb_write_buffer_manager_create_with_cache*( + buffer_size: csize_t, cache: ptr rocksdb_cache_t, allow_stall: bool +): ptr rocksdb_write_buffer_manager_t {. + cdecl, importc: "rocksdb_write_buffer_manager_create_with_cache", dynlib: librocksdb +.} + proc rocksdb_write_buffer_manager_destroy*( - wbm: ptr rocksdb_write_buffer_manager_t) {.cdecl, - importc: "rocksdb_write_buffer_manager_destroy", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +) {.cdecl, importc: "rocksdb_write_buffer_manager_destroy", dynlib: librocksdb.} + proc rocksdb_write_buffer_manager_enabled*( - wbm: ptr rocksdb_write_buffer_manager_t): bool {.cdecl, - importc: "rocksdb_write_buffer_manager_enabled", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +): bool {.cdecl, importc: "rocksdb_write_buffer_manager_enabled", dynlib: librocksdb.} + proc rocksdb_write_buffer_manager_cost_to_cache*( - wbm: ptr rocksdb_write_buffer_manager_t): bool {.cdecl, - importc: "rocksdb_write_buffer_manager_cost_to_cache", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +): bool {. + cdecl, importc: "rocksdb_write_buffer_manager_cost_to_cache", dynlib: librocksdb +.} + proc rocksdb_write_buffer_manager_memory_usage*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl, - importc: "rocksdb_write_buffer_manager_memory_usage", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {. + cdecl, importc: "rocksdb_write_buffer_manager_memory_usage", dynlib: librocksdb +.} + proc rocksdb_write_buffer_manager_mutable_memtable_memory_usage*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl, - importc: "rocksdb_write_buffer_manager_mutable_memtable_memory_usage", - dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {. + cdecl, + importc: "rocksdb_write_buffer_manager_mutable_memtable_memory_usage", + dynlib: librocksdb +.} + proc rocksdb_write_buffer_manager_dummy_entries_in_cache_usage*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl, - importc: "rocksdb_write_buffer_manager_dummy_entries_in_cache_usage", - dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {. + cdecl, + importc: "rocksdb_write_buffer_manager_dummy_entries_in_cache_usage", + dynlib: librocksdb +.} + proc rocksdb_write_buffer_manager_buffer_size*( - wbm: ptr rocksdb_write_buffer_manager_t): csize_t {.cdecl, - importc: "rocksdb_write_buffer_manager_buffer_size", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t +): csize_t {. + cdecl, importc: "rocksdb_write_buffer_manager_buffer_size", dynlib: librocksdb +.} + proc rocksdb_write_buffer_manager_set_buffer_size*( - wbm: ptr rocksdb_write_buffer_manager_t; new_size: csize_t) {.cdecl, - importc: "rocksdb_write_buffer_manager_set_buffer_size", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t, new_size: csize_t +) {.cdecl, importc: "rocksdb_write_buffer_manager_set_buffer_size", dynlib: librocksdb.} + proc rocksdb_write_buffer_manager_set_allow_stall*( - wbm: ptr rocksdb_write_buffer_manager_t; new_allow_stall: bool) {.cdecl, - importc: "rocksdb_write_buffer_manager_set_allow_stall", dynlib: librocksdb.} + wbm: ptr rocksdb_write_buffer_manager_t, new_allow_stall: bool +) {.cdecl, importc: "rocksdb_write_buffer_manager_set_allow_stall", dynlib: librocksdb.} + ## HyperClockCache -proc rocksdb_hyper_clock_cache_options_create*(capacity: csize_t; - estimated_entry_charge: csize_t): ptr rocksdb_hyper_clock_cache_options_t {. - cdecl, importc: "rocksdb_hyper_clock_cache_options_create", dynlib: librocksdb.} +proc rocksdb_hyper_clock_cache_options_create*( + capacity: csize_t, estimated_entry_charge: csize_t +): ptr rocksdb_hyper_clock_cache_options_t {. + cdecl, importc: "rocksdb_hyper_clock_cache_options_create", dynlib: librocksdb +.} + proc rocksdb_hyper_clock_cache_options_destroy*( - a1: ptr rocksdb_hyper_clock_cache_options_t) {.cdecl, - importc: "rocksdb_hyper_clock_cache_options_destroy", dynlib: librocksdb.} + a1: ptr rocksdb_hyper_clock_cache_options_t +) {.cdecl, importc: "rocksdb_hyper_clock_cache_options_destroy", dynlib: librocksdb.} + proc rocksdb_hyper_clock_cache_options_set_capacity*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: csize_t) {.cdecl, - importc: "rocksdb_hyper_clock_cache_options_set_capacity", dynlib: librocksdb.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: csize_t +) {. + cdecl, importc: "rocksdb_hyper_clock_cache_options_set_capacity", dynlib: librocksdb +.} + proc rocksdb_hyper_clock_cache_options_set_estimated_entry_charge*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: csize_t) {.cdecl, - importc: "rocksdb_hyper_clock_cache_options_set_estimated_entry_charge", - dynlib: librocksdb.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: csize_t +) {. + cdecl, + importc: "rocksdb_hyper_clock_cache_options_set_estimated_entry_charge", + dynlib: librocksdb +.} + proc rocksdb_hyper_clock_cache_options_set_num_shard_bits*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: cint) {.cdecl, - importc: "rocksdb_hyper_clock_cache_options_set_num_shard_bits", - dynlib: librocksdb.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_hyper_clock_cache_options_set_num_shard_bits", + dynlib: librocksdb +.} + proc rocksdb_hyper_clock_cache_options_set_memory_allocator*( - a1: ptr rocksdb_hyper_clock_cache_options_t; a2: ptr rocksdb_memory_allocator_t) {. - cdecl, importc: "rocksdb_hyper_clock_cache_options_set_memory_allocator", - dynlib: librocksdb.} -proc rocksdb_cache_create_hyper_clock*(capacity: csize_t; - estimated_entry_charge: csize_t): ptr rocksdb_cache_t {. - cdecl, importc: "rocksdb_cache_create_hyper_clock", dynlib: librocksdb.} + a1: ptr rocksdb_hyper_clock_cache_options_t, a2: ptr rocksdb_memory_allocator_t +) {. + cdecl, + importc: "rocksdb_hyper_clock_cache_options_set_memory_allocator", + dynlib: librocksdb +.} + +proc rocksdb_cache_create_hyper_clock*( + capacity: csize_t, estimated_entry_charge: csize_t +): ptr rocksdb_cache_t {. + cdecl, importc: "rocksdb_cache_create_hyper_clock", dynlib: librocksdb +.} + proc rocksdb_cache_create_hyper_clock_opts*( - a1: ptr rocksdb_hyper_clock_cache_options_t): ptr rocksdb_cache_t {.cdecl, - importc: "rocksdb_cache_create_hyper_clock_opts", dynlib: librocksdb.} + a1: ptr rocksdb_hyper_clock_cache_options_t +): ptr rocksdb_cache_t {. + cdecl, importc: "rocksdb_cache_create_hyper_clock_opts", dynlib: librocksdb +.} + ## DBPath -proc rocksdb_dbpath_create*(path: cstring; target_size: uint64): ptr rocksdb_dbpath_t {. - cdecl, importc: "rocksdb_dbpath_create", dynlib: librocksdb.} -proc rocksdb_dbpath_destroy*(a1: ptr rocksdb_dbpath_t) {.cdecl, - importc: "rocksdb_dbpath_destroy", dynlib: librocksdb.} +proc rocksdb_dbpath_create*( + path: cstring, target_size: uint64 +): ptr rocksdb_dbpath_t {.cdecl, importc: "rocksdb_dbpath_create", dynlib: librocksdb.} + +proc rocksdb_dbpath_destroy*( + a1: ptr rocksdb_dbpath_t +) {.cdecl, importc: "rocksdb_dbpath_destroy", dynlib: librocksdb.} + ## Env -proc rocksdb_create_default_env*(): ptr rocksdb_env_t {.cdecl, - importc: "rocksdb_create_default_env", dynlib: librocksdb.} -proc rocksdb_create_mem_env*(): ptr rocksdb_env_t {.cdecl, - importc: "rocksdb_create_mem_env", dynlib: librocksdb.} -proc rocksdb_env_set_background_threads*(env: ptr rocksdb_env_t; n: cint) {.cdecl, - importc: "rocksdb_env_set_background_threads", dynlib: librocksdb.} -proc rocksdb_env_get_background_threads*(env: ptr rocksdb_env_t): cint {.cdecl, - importc: "rocksdb_env_get_background_threads", dynlib: librocksdb.} -proc rocksdb_env_set_high_priority_background_threads*(env: ptr rocksdb_env_t; - n: cint) {.cdecl, importc: "rocksdb_env_set_high_priority_background_threads", - dynlib: librocksdb.} -proc rocksdb_env_get_high_priority_background_threads*(env: ptr rocksdb_env_t): cint {. - cdecl, importc: "rocksdb_env_get_high_priority_background_threads", - dynlib: librocksdb.} -proc rocksdb_env_set_low_priority_background_threads*(env: ptr rocksdb_env_t; - n: cint) {.cdecl, importc: "rocksdb_env_set_low_priority_background_threads", - dynlib: librocksdb.} -proc rocksdb_env_get_low_priority_background_threads*(env: ptr rocksdb_env_t): cint {. - cdecl, importc: "rocksdb_env_get_low_priority_background_threads", - dynlib: librocksdb.} -proc rocksdb_env_set_bottom_priority_background_threads*(env: ptr rocksdb_env_t; - n: cint) {.cdecl, - importc: "rocksdb_env_set_bottom_priority_background_threads", - dynlib: librocksdb.} -proc rocksdb_env_get_bottom_priority_background_threads*(env: ptr rocksdb_env_t): cint {. - cdecl, importc: "rocksdb_env_get_bottom_priority_background_threads", - dynlib: librocksdb.} -proc rocksdb_env_join_all_threads*(env: ptr rocksdb_env_t) {.cdecl, - importc: "rocksdb_env_join_all_threads", dynlib: librocksdb.} -proc rocksdb_env_lower_thread_pool_io_priority*(env: ptr rocksdb_env_t) {.cdecl, - importc: "rocksdb_env_lower_thread_pool_io_priority", dynlib: librocksdb.} +proc rocksdb_create_default_env*(): ptr rocksdb_env_t {. + cdecl, importc: "rocksdb_create_default_env", dynlib: librocksdb +.} + +proc rocksdb_create_mem_env*(): ptr rocksdb_env_t {. + cdecl, importc: "rocksdb_create_mem_env", dynlib: librocksdb +.} + +proc rocksdb_env_set_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {.cdecl, importc: "rocksdb_env_set_background_threads", dynlib: librocksdb.} + +proc rocksdb_env_get_background_threads*( + env: ptr rocksdb_env_t +): cint {.cdecl, importc: "rocksdb_env_get_background_threads", dynlib: librocksdb.} + +proc rocksdb_env_set_high_priority_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {. + cdecl, importc: "rocksdb_env_set_high_priority_background_threads", dynlib: librocksdb +.} + +proc rocksdb_env_get_high_priority_background_threads*( + env: ptr rocksdb_env_t +): cint {. + cdecl, importc: "rocksdb_env_get_high_priority_background_threads", dynlib: librocksdb +.} + +proc rocksdb_env_set_low_priority_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {. + cdecl, importc: "rocksdb_env_set_low_priority_background_threads", dynlib: librocksdb +.} + +proc rocksdb_env_get_low_priority_background_threads*( + env: ptr rocksdb_env_t +): cint {. + cdecl, importc: "rocksdb_env_get_low_priority_background_threads", dynlib: librocksdb +.} + +proc rocksdb_env_set_bottom_priority_background_threads*( + env: ptr rocksdb_env_t, n: cint +) {. + cdecl, + importc: "rocksdb_env_set_bottom_priority_background_threads", + dynlib: librocksdb +.} + +proc rocksdb_env_get_bottom_priority_background_threads*( + env: ptr rocksdb_env_t +): cint {. + cdecl, + importc: "rocksdb_env_get_bottom_priority_background_threads", + dynlib: librocksdb +.} + +proc rocksdb_env_join_all_threads*( + env: ptr rocksdb_env_t +) {.cdecl, importc: "rocksdb_env_join_all_threads", dynlib: librocksdb.} + +proc rocksdb_env_lower_thread_pool_io_priority*( + env: ptr rocksdb_env_t +) {.cdecl, importc: "rocksdb_env_lower_thread_pool_io_priority", dynlib: librocksdb.} + proc rocksdb_env_lower_high_priority_thread_pool_io_priority*( - env: ptr rocksdb_env_t) {.cdecl, importc: "rocksdb_env_lower_high_priority_thread_pool_io_priority", - dynlib: librocksdb.} -proc rocksdb_env_lower_thread_pool_cpu_priority*(env: ptr rocksdb_env_t) {.cdecl, - importc: "rocksdb_env_lower_thread_pool_cpu_priority", dynlib: librocksdb.} + env: ptr rocksdb_env_t +) {. + cdecl, + importc: "rocksdb_env_lower_high_priority_thread_pool_io_priority", + dynlib: librocksdb +.} + +proc rocksdb_env_lower_thread_pool_cpu_priority*( + env: ptr rocksdb_env_t +) {.cdecl, importc: "rocksdb_env_lower_thread_pool_cpu_priority", dynlib: librocksdb.} + proc rocksdb_env_lower_high_priority_thread_pool_cpu_priority*( - env: ptr rocksdb_env_t) {.cdecl, importc: "rocksdb_env_lower_high_priority_thread_pool_cpu_priority", - dynlib: librocksdb.} -proc rocksdb_env_destroy*(a1: ptr rocksdb_env_t) {.cdecl, - importc: "rocksdb_env_destroy", dynlib: librocksdb.} -proc rocksdb_envoptions_create*(): ptr rocksdb_envoptions_t {.cdecl, - importc: "rocksdb_envoptions_create", dynlib: librocksdb.} -proc rocksdb_envoptions_destroy*(opt: ptr rocksdb_envoptions_t) {.cdecl, - importc: "rocksdb_envoptions_destroy", dynlib: librocksdb.} -proc rocksdb_create_dir_if_missing*(env: ptr rocksdb_env_t; path: cstring; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_create_dir_if_missing", dynlib: librocksdb.} + env: ptr rocksdb_env_t +) {. + cdecl, + importc: "rocksdb_env_lower_high_priority_thread_pool_cpu_priority", + dynlib: librocksdb +.} + +proc rocksdb_env_destroy*( + a1: ptr rocksdb_env_t +) {.cdecl, importc: "rocksdb_env_destroy", dynlib: librocksdb.} + +proc rocksdb_envoptions_create*(): ptr rocksdb_envoptions_t {. + cdecl, importc: "rocksdb_envoptions_create", dynlib: librocksdb +.} + +proc rocksdb_envoptions_destroy*( + opt: ptr rocksdb_envoptions_t +) {.cdecl, importc: "rocksdb_envoptions_destroy", dynlib: librocksdb.} + +proc rocksdb_create_dir_if_missing*( + env: ptr rocksdb_env_t, path: cstring, errptr: cstringArray +) {.cdecl, importc: "rocksdb_create_dir_if_missing", dynlib: librocksdb.} + ## SstFile -proc rocksdb_sstfilewriter_create*(env: ptr rocksdb_envoptions_t; - io_options: ptr rocksdb_options_t): ptr rocksdb_sstfilewriter_t {. - cdecl, importc: "rocksdb_sstfilewriter_create", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_create_with_comparator*(env: ptr rocksdb_envoptions_t; - io_options: ptr rocksdb_options_t; comparator: ptr rocksdb_comparator_t): ptr rocksdb_sstfilewriter_t {. - cdecl, importc: "rocksdb_sstfilewriter_create_with_comparator", - dynlib: librocksdb.} -proc rocksdb_sstfilewriter_open*(writer: ptr rocksdb_sstfilewriter_t; name: cstring; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_open", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_add*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_add", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_put*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_put", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_put_with_ts*(writer: ptr rocksdb_sstfilewriter_t; - key: cstring; keylen: csize_t; ts: cstring; - tslen: csize_t; val: cstring; - vallen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_sstfilewriter_put_with_ts", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_merge*(writer: ptr rocksdb_sstfilewriter_t; key: cstring; - keylen: csize_t; val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_merge", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_delete*(writer: ptr rocksdb_sstfilewriter_t; - key: cstring; keylen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_delete", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_delete_with_ts*(writer: ptr rocksdb_sstfilewriter_t; - key: cstring; keylen: csize_t; ts: cstring; tslen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_sstfilewriter_delete_with_ts", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_delete_range*(writer: ptr rocksdb_sstfilewriter_t; - begin_key: cstring; begin_keylen: csize_t; - end_key: cstring; end_keylen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_delete_range", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_finish*(writer: ptr rocksdb_sstfilewriter_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_sstfilewriter_finish", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_file_size*(writer: ptr rocksdb_sstfilewriter_t; - file_size: ptr uint64) {.cdecl, - importc: "rocksdb_sstfilewriter_file_size", dynlib: librocksdb.} -proc rocksdb_sstfilewriter_destroy*(writer: ptr rocksdb_sstfilewriter_t) {.cdecl, - importc: "rocksdb_sstfilewriter_destroy", dynlib: librocksdb.} +proc rocksdb_sstfilewriter_create*( + env: ptr rocksdb_envoptions_t, io_options: ptr rocksdb_options_t +): ptr rocksdb_sstfilewriter_t {. + cdecl, importc: "rocksdb_sstfilewriter_create", dynlib: librocksdb +.} + +proc rocksdb_sstfilewriter_create_with_comparator*( + env: ptr rocksdb_envoptions_t, + io_options: ptr rocksdb_options_t, + comparator: ptr rocksdb_comparator_t, +): ptr rocksdb_sstfilewriter_t {. + cdecl, importc: "rocksdb_sstfilewriter_create_with_comparator", dynlib: librocksdb +.} + +proc rocksdb_sstfilewriter_open*( + writer: ptr rocksdb_sstfilewriter_t, name: cstring, errptr: cstringArray +) {.cdecl, importc: "rocksdb_sstfilewriter_open", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_add*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_add", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_put*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_put", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_put_with_ts*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_put_with_ts", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_merge*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_merge", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_delete*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_delete", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_delete_with_ts*( + writer: ptr rocksdb_sstfilewriter_t, + key: cstring, + keylen: csize_t, + ts: cstring, + tslen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_delete_with_ts", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_delete_range*( + writer: ptr rocksdb_sstfilewriter_t, + begin_key: cstring, + begin_keylen: csize_t, + end_key: cstring, + end_keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_sstfilewriter_delete_range", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_finish*( + writer: ptr rocksdb_sstfilewriter_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_sstfilewriter_finish", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_file_size*( + writer: ptr rocksdb_sstfilewriter_t, file_size: ptr uint64 +) {.cdecl, importc: "rocksdb_sstfilewriter_file_size", dynlib: librocksdb.} + +proc rocksdb_sstfilewriter_destroy*( + writer: ptr rocksdb_sstfilewriter_t +) {.cdecl, importc: "rocksdb_sstfilewriter_destroy", dynlib: librocksdb.} + proc rocksdb_ingestexternalfileoptions_create*(): ptr rocksdb_ingestexternalfileoptions_t {. - cdecl, importc: "rocksdb_ingestexternalfileoptions_create", dynlib: librocksdb.} + cdecl, importc: "rocksdb_ingestexternalfileoptions_create", dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_set_move_files*( - opt: ptr rocksdb_ingestexternalfileoptions_t; move_files: uint8) {.cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_move_files", - dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t, move_files: uint8 +) {. + cdecl, importc: "rocksdb_ingestexternalfileoptions_set_move_files", dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_set_snapshot_consistency*( - opt: ptr rocksdb_ingestexternalfileoptions_t; snapshot_consistency: uint8) {. - cdecl, importc: "rocksdb_ingestexternalfileoptions_set_snapshot_consistency", - dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t, snapshot_consistency: uint8 +) {. + cdecl, + importc: "rocksdb_ingestexternalfileoptions_set_snapshot_consistency", + dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_set_allow_global_seqno*( - opt: ptr rocksdb_ingestexternalfileoptions_t; allow_global_seqno: uint8) {.cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_allow_global_seqno", - dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t, allow_global_seqno: uint8 +) {. + cdecl, + importc: "rocksdb_ingestexternalfileoptions_set_allow_global_seqno", + dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_set_allow_blocking_flush*( - opt: ptr rocksdb_ingestexternalfileoptions_t; allow_blocking_flush: uint8) {. - cdecl, importc: "rocksdb_ingestexternalfileoptions_set_allow_blocking_flush", - dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t, allow_blocking_flush: uint8 +) {. + cdecl, + importc: "rocksdb_ingestexternalfileoptions_set_allow_blocking_flush", + dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_set_ingest_behind*( - opt: ptr rocksdb_ingestexternalfileoptions_t; ingest_behind: uint8) {.cdecl, - importc: "rocksdb_ingestexternalfileoptions_set_ingest_behind", - dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t, ingest_behind: uint8 +) {. + cdecl, + importc: "rocksdb_ingestexternalfileoptions_set_ingest_behind", + dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_set_fail_if_not_bottommost_level*( - opt: ptr rocksdb_ingestexternalfileoptions_t; - fail_if_not_bottommost_level: uint8) {.cdecl, importc: "rocksdb_ingestexternalfileoptions_set_fail_if_not_bottommost_level", - dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t, fail_if_not_bottommost_level: uint8 +) {. + cdecl, + importc: "rocksdb_ingestexternalfileoptions_set_fail_if_not_bottommost_level", + dynlib: librocksdb +.} + proc rocksdb_ingestexternalfileoptions_destroy*( - opt: ptr rocksdb_ingestexternalfileoptions_t) {.cdecl, - importc: "rocksdb_ingestexternalfileoptions_destroy", dynlib: librocksdb.} -proc rocksdb_ingest_external_file*(db: ptr rocksdb_t; file_list: cstringArray; - list_len: csize_t; - opt: ptr rocksdb_ingestexternalfileoptions_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_ingest_external_file", dynlib: librocksdb.} -proc rocksdb_ingest_external_file_cf*(db: ptr rocksdb_t; handle: ptr rocksdb_column_family_handle_t; - file_list: cstringArray; list_len: csize_t; opt: ptr rocksdb_ingestexternalfileoptions_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_ingest_external_file_cf", dynlib: librocksdb.} -proc rocksdb_try_catch_up_with_primary*(db: ptr rocksdb_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_try_catch_up_with_primary", dynlib: librocksdb.} + opt: ptr rocksdb_ingestexternalfileoptions_t +) {.cdecl, importc: "rocksdb_ingestexternalfileoptions_destroy", dynlib: librocksdb.} + +proc rocksdb_ingest_external_file*( + db: ptr rocksdb_t, + file_list: cstringArray, + list_len: csize_t, + opt: ptr rocksdb_ingestexternalfileoptions_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_ingest_external_file", dynlib: librocksdb.} + +proc rocksdb_ingest_external_file_cf*( + db: ptr rocksdb_t, + handle: ptr rocksdb_column_family_handle_t, + file_list: cstringArray, + list_len: csize_t, + opt: ptr rocksdb_ingestexternalfileoptions_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_ingest_external_file_cf", dynlib: librocksdb.} + +proc rocksdb_try_catch_up_with_primary*( + db: ptr rocksdb_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_try_catch_up_with_primary", dynlib: librocksdb.} + ## SliceTransform -proc rocksdb_slicetransform_create*(state: pointer; - destructor: proc (a1: pointer) {.cdecl.}; - transform: proc (a1: pointer; key: cstring; length: csize_t; dst_length: ptr csize_t): cstring {. - cdecl.}; in_domain: proc (a1: pointer; key: cstring; length: csize_t): uint8 {.cdecl.}; - in_range: proc (a1: pointer; key: cstring; length: csize_t): uint8 {.cdecl.}; - name: proc (a1: pointer): cstring {.cdecl.}): ptr rocksdb_slicetransform_t {. - cdecl, importc: "rocksdb_slicetransform_create", dynlib: librocksdb.} -proc rocksdb_slicetransform_create_fixed_prefix*(a1: csize_t): ptr rocksdb_slicetransform_t {. - cdecl, importc: "rocksdb_slicetransform_create_fixed_prefix", - dynlib: librocksdb.} -proc rocksdb_slicetransform_create_noop*(): ptr rocksdb_slicetransform_t {.cdecl, - importc: "rocksdb_slicetransform_create_noop", dynlib: librocksdb.} -proc rocksdb_slicetransform_destroy*(a1: ptr rocksdb_slicetransform_t) {.cdecl, - importc: "rocksdb_slicetransform_destroy", dynlib: librocksdb.} +proc rocksdb_slicetransform_create*( + state: pointer, + destructor: proc(a1: pointer) {.cdecl.}, + transform: proc( + a1: pointer, key: cstring, length: csize_t, dst_length: ptr csize_t + ): cstring {.cdecl.}, + in_domain: proc(a1: pointer, key: cstring, length: csize_t): uint8 {.cdecl.}, + in_range: proc(a1: pointer, key: cstring, length: csize_t): uint8 {.cdecl.}, + name: proc(a1: pointer): cstring {.cdecl.}, +): ptr rocksdb_slicetransform_t {. + cdecl, importc: "rocksdb_slicetransform_create", dynlib: librocksdb +.} + +proc rocksdb_slicetransform_create_fixed_prefix*( + a1: csize_t +): ptr rocksdb_slicetransform_t {. + cdecl, importc: "rocksdb_slicetransform_create_fixed_prefix", dynlib: librocksdb +.} + +proc rocksdb_slicetransform_create_noop*(): ptr rocksdb_slicetransform_t {. + cdecl, importc: "rocksdb_slicetransform_create_noop", dynlib: librocksdb +.} + +proc rocksdb_slicetransform_destroy*( + a1: ptr rocksdb_slicetransform_t +) {.cdecl, importc: "rocksdb_slicetransform_destroy", dynlib: librocksdb.} + ## Universal Compaction options const @@ -2402,118 +4466,227 @@ const rocksdb_total_size_compaction_stop_style* = 1 proc rocksdb_universal_compaction_options_create*(): ptr rocksdb_universal_compaction_options_t {. - cdecl, importc: "rocksdb_universal_compaction_options_create", - dynlib: librocksdb.} + cdecl, importc: "rocksdb_universal_compaction_options_create", dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_set_size_ratio*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl, - importc: "rocksdb_universal_compaction_options_set_size_ratio", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_universal_compaction_options_set_size_ratio", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_get_size_ratio*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl, - importc: "rocksdb_universal_compaction_options_get_size_ratio", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {. + cdecl, + importc: "rocksdb_universal_compaction_options_get_size_ratio", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_set_min_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl, - importc: "rocksdb_universal_compaction_options_set_min_merge_width", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_universal_compaction_options_set_min_merge_width", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_get_min_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl, - importc: "rocksdb_universal_compaction_options_get_min_merge_width", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {. + cdecl, + importc: "rocksdb_universal_compaction_options_get_min_merge_width", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_set_max_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl, - importc: "rocksdb_universal_compaction_options_set_max_merge_width", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_universal_compaction_options_set_max_merge_width", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_get_max_merge_width*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl, - importc: "rocksdb_universal_compaction_options_get_max_merge_width", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {. + cdecl, + importc: "rocksdb_universal_compaction_options_get_max_merge_width", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_set_max_size_amplification_percent*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl, importc: "rocksdb_universal_compaction_options_set_max_size_amplification_percent", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_universal_compaction_options_set_max_size_amplification_percent", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_get_max_size_amplification_percent*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl, importc: "rocksdb_universal_compaction_options_get_max_size_amplification_percent", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {. + cdecl, + importc: "rocksdb_universal_compaction_options_get_max_size_amplification_percent", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_set_compression_size_percent*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl, importc: "rocksdb_universal_compaction_options_set_compression_size_percent", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_universal_compaction_options_set_compression_size_percent", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_get_compression_size_percent*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl, importc: "rocksdb_universal_compaction_options_get_compression_size_percent", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {. + cdecl, + importc: "rocksdb_universal_compaction_options_get_compression_size_percent", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_set_stop_style*( - a1: ptr rocksdb_universal_compaction_options_t; a2: cint) {.cdecl, - importc: "rocksdb_universal_compaction_options_set_stop_style", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t, a2: cint +) {. + cdecl, + importc: "rocksdb_universal_compaction_options_set_stop_style", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_get_stop_style*( - a1: ptr rocksdb_universal_compaction_options_t): cint {.cdecl, - importc: "rocksdb_universal_compaction_options_get_stop_style", - dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +): cint {. + cdecl, + importc: "rocksdb_universal_compaction_options_get_stop_style", + dynlib: librocksdb +.} + proc rocksdb_universal_compaction_options_destroy*( - a1: ptr rocksdb_universal_compaction_options_t) {.cdecl, - importc: "rocksdb_universal_compaction_options_destroy", dynlib: librocksdb.} + a1: ptr rocksdb_universal_compaction_options_t +) {.cdecl, importc: "rocksdb_universal_compaction_options_destroy", dynlib: librocksdb.} + proc rocksdb_fifo_compaction_options_create*(): ptr rocksdb_fifo_compaction_options_t {. - cdecl, importc: "rocksdb_fifo_compaction_options_create", dynlib: librocksdb.} + cdecl, importc: "rocksdb_fifo_compaction_options_create", dynlib: librocksdb +.} + proc rocksdb_fifo_compaction_options_set_allow_compaction*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t; allow_compaction: uint8) {. - cdecl, importc: "rocksdb_fifo_compaction_options_set_allow_compaction", - dynlib: librocksdb.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t, allow_compaction: uint8 +) {. + cdecl, + importc: "rocksdb_fifo_compaction_options_set_allow_compaction", + dynlib: librocksdb +.} + proc rocksdb_fifo_compaction_options_get_allow_compaction*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t): uint8 {.cdecl, - importc: "rocksdb_fifo_compaction_options_get_allow_compaction", - dynlib: librocksdb.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t +): uint8 {. + cdecl, + importc: "rocksdb_fifo_compaction_options_get_allow_compaction", + dynlib: librocksdb +.} + proc rocksdb_fifo_compaction_options_set_max_table_files_size*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t; size: uint64) {.cdecl, - importc: "rocksdb_fifo_compaction_options_set_max_table_files_size", - dynlib: librocksdb.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t, size: uint64 +) {. + cdecl, + importc: "rocksdb_fifo_compaction_options_set_max_table_files_size", + dynlib: librocksdb +.} + proc rocksdb_fifo_compaction_options_get_max_table_files_size*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t): uint64 {.cdecl, - importc: "rocksdb_fifo_compaction_options_get_max_table_files_size", - dynlib: librocksdb.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t +): uint64 {. + cdecl, + importc: "rocksdb_fifo_compaction_options_get_max_table_files_size", + dynlib: librocksdb +.} + proc rocksdb_fifo_compaction_options_destroy*( - fifo_opts: ptr rocksdb_fifo_compaction_options_t) {.cdecl, - importc: "rocksdb_fifo_compaction_options_destroy", dynlib: librocksdb.} -proc rocksdb_livefiles_count*(a1: ptr rocksdb_livefiles_t): cint {.cdecl, - importc: "rocksdb_livefiles_count", dynlib: librocksdb.} -proc rocksdb_livefiles_column_family_name*(a1: ptr rocksdb_livefiles_t; index: cint): cstring {. - cdecl, importc: "rocksdb_livefiles_column_family_name", dynlib: librocksdb.} -proc rocksdb_livefiles_name*(a1: ptr rocksdb_livefiles_t; index: cint): cstring {. - cdecl, importc: "rocksdb_livefiles_name", dynlib: librocksdb.} -proc rocksdb_livefiles_level*(a1: ptr rocksdb_livefiles_t; index: cint): cint {.cdecl, - importc: "rocksdb_livefiles_level", dynlib: librocksdb.} -proc rocksdb_livefiles_size*(a1: ptr rocksdb_livefiles_t; index: cint): csize_t {. - cdecl, importc: "rocksdb_livefiles_size", dynlib: librocksdb.} -proc rocksdb_livefiles_smallestkey*(a1: ptr rocksdb_livefiles_t; index: cint; - size: ptr csize_t): cstring {.cdecl, - importc: "rocksdb_livefiles_smallestkey", dynlib: librocksdb.} -proc rocksdb_livefiles_largestkey*(a1: ptr rocksdb_livefiles_t; index: cint; - size: ptr csize_t): cstring {.cdecl, - importc: "rocksdb_livefiles_largestkey", dynlib: librocksdb.} -proc rocksdb_livefiles_entries*(a1: ptr rocksdb_livefiles_t; index: cint): uint64 {. - cdecl, importc: "rocksdb_livefiles_entries", dynlib: librocksdb.} -proc rocksdb_livefiles_deletions*(a1: ptr rocksdb_livefiles_t; index: cint): uint64 {. - cdecl, importc: "rocksdb_livefiles_deletions", dynlib: librocksdb.} -proc rocksdb_livefiles_destroy*(a1: ptr rocksdb_livefiles_t) {.cdecl, - importc: "rocksdb_livefiles_destroy", dynlib: librocksdb.} + fifo_opts: ptr rocksdb_fifo_compaction_options_t +) {.cdecl, importc: "rocksdb_fifo_compaction_options_destroy", dynlib: librocksdb.} + +proc rocksdb_livefiles_count*( + a1: ptr rocksdb_livefiles_t +): cint {.cdecl, importc: "rocksdb_livefiles_count", dynlib: librocksdb.} + +proc rocksdb_livefiles_column_family_name*( + a1: ptr rocksdb_livefiles_t, index: cint +): cstring {. + cdecl, importc: "rocksdb_livefiles_column_family_name", dynlib: librocksdb +.} + +proc rocksdb_livefiles_name*( + a1: ptr rocksdb_livefiles_t, index: cint +): cstring {.cdecl, importc: "rocksdb_livefiles_name", dynlib: librocksdb.} + +proc rocksdb_livefiles_level*( + a1: ptr rocksdb_livefiles_t, index: cint +): cint {.cdecl, importc: "rocksdb_livefiles_level", dynlib: librocksdb.} + +proc rocksdb_livefiles_size*( + a1: ptr rocksdb_livefiles_t, index: cint +): csize_t {.cdecl, importc: "rocksdb_livefiles_size", dynlib: librocksdb.} + +proc rocksdb_livefiles_smallestkey*( + a1: ptr rocksdb_livefiles_t, index: cint, size: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_livefiles_smallestkey", dynlib: librocksdb.} + +proc rocksdb_livefiles_largestkey*( + a1: ptr rocksdb_livefiles_t, index: cint, size: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_livefiles_largestkey", dynlib: librocksdb.} + +proc rocksdb_livefiles_entries*( + a1: ptr rocksdb_livefiles_t, index: cint +): uint64 {.cdecl, importc: "rocksdb_livefiles_entries", dynlib: librocksdb.} + +proc rocksdb_livefiles_deletions*( + a1: ptr rocksdb_livefiles_t, index: cint +): uint64 {.cdecl, importc: "rocksdb_livefiles_deletions", dynlib: librocksdb.} + +proc rocksdb_livefiles_destroy*( + a1: ptr rocksdb_livefiles_t +) {.cdecl, importc: "rocksdb_livefiles_destroy", dynlib: librocksdb.} + ## Utility Helpers -proc rocksdb_get_options_from_string*(base_options: ptr rocksdb_options_t; - opts_str: cstring; - new_options: ptr rocksdb_options_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_get_options_from_string", dynlib: librocksdb.} -proc rocksdb_delete_file_in_range*(db: ptr rocksdb_t; start_key: cstring; - start_key_len: csize_t; limit_key: cstring; - limit_key_len: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_delete_file_in_range", dynlib: librocksdb.} -proc rocksdb_delete_file_in_range_cf*(db: ptr rocksdb_t; column_family: ptr rocksdb_column_family_handle_t; - start_key: cstring; start_key_len: csize_t; - limit_key: cstring; limit_key_len: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_delete_file_in_range_cf", dynlib: librocksdb.} +proc rocksdb_get_options_from_string*( + base_options: ptr rocksdb_options_t, + opts_str: cstring, + new_options: ptr rocksdb_options_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_get_options_from_string", dynlib: librocksdb.} + +proc rocksdb_delete_file_in_range*( + db: ptr rocksdb_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete_file_in_range", dynlib: librocksdb.} + +proc rocksdb_delete_file_in_range_cf*( + db: ptr rocksdb_t, + column_family: ptr rocksdb_column_family_handle_t, + start_key: cstring, + start_key_len: csize_t, + limit_key: cstring, + limit_key_len: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_delete_file_in_range_cf", dynlib: librocksdb.} + ## MetaData -proc rocksdb_get_column_family_metadata*(db: ptr rocksdb_t): ptr rocksdb_column_family_metadata_t {. - cdecl, importc: "rocksdb_get_column_family_metadata", dynlib: librocksdb.} +proc rocksdb_get_column_family_metadata*( + db: ptr rocksdb_t +): ptr rocksdb_column_family_metadata_t {. + cdecl, importc: "rocksdb_get_column_family_metadata", dynlib: librocksdb +.} + ## ## Returns the rocksdb_column_family_metadata_t of the specified ## column family. @@ -2522,24 +4695,40 @@ proc rocksdb_get_column_family_metadata*(db: ptr rocksdb_t): ptr rocksdb_column_ ## using rocksdb_column_family_metadata_destroy. ## -proc rocksdb_get_column_family_metadata_cf*(db: ptr rocksdb_t; - column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_column_family_metadata_t {. - cdecl, importc: "rocksdb_get_column_family_metadata_cf", dynlib: librocksdb.} +proc rocksdb_get_column_family_metadata_cf*( + db: ptr rocksdb_t, column_family: ptr rocksdb_column_family_handle_t +): ptr rocksdb_column_family_metadata_t {. + cdecl, importc: "rocksdb_get_column_family_metadata_cf", dynlib: librocksdb +.} + proc rocksdb_column_family_metadata_destroy*( - cf_meta: ptr rocksdb_column_family_metadata_t) {.cdecl, - importc: "rocksdb_column_family_metadata_destroy", dynlib: librocksdb.} + cf_meta: ptr rocksdb_column_family_metadata_t +) {.cdecl, importc: "rocksdb_column_family_metadata_destroy", dynlib: librocksdb.} + proc rocksdb_column_family_metadata_get_size*( - cf_meta: ptr rocksdb_column_family_metadata_t): uint64 {.cdecl, - importc: "rocksdb_column_family_metadata_get_size", dynlib: librocksdb.} + cf_meta: ptr rocksdb_column_family_metadata_t +): uint64 {. + cdecl, importc: "rocksdb_column_family_metadata_get_size", dynlib: librocksdb +.} + proc rocksdb_column_family_metadata_get_file_count*( - cf_meta: ptr rocksdb_column_family_metadata_t): csize_t {.cdecl, - importc: "rocksdb_column_family_metadata_get_file_count", dynlib: librocksdb.} + cf_meta: ptr rocksdb_column_family_metadata_t +): csize_t {. + cdecl, importc: "rocksdb_column_family_metadata_get_file_count", dynlib: librocksdb +.} + proc rocksdb_column_family_metadata_get_name*( - cf_meta: ptr rocksdb_column_family_metadata_t): cstring {.cdecl, - importc: "rocksdb_column_family_metadata_get_name", dynlib: librocksdb.} + cf_meta: ptr rocksdb_column_family_metadata_t +): cstring {. + cdecl, importc: "rocksdb_column_family_metadata_get_name", dynlib: librocksdb +.} + proc rocksdb_column_family_metadata_get_level_count*( - cf_meta: ptr rocksdb_column_family_metadata_t): csize_t {.cdecl, - importc: "rocksdb_column_family_metadata_get_level_count", dynlib: librocksdb.} + cf_meta: ptr rocksdb_column_family_metadata_t +): csize_t {. + cdecl, importc: "rocksdb_column_family_metadata_get_level_count", dynlib: librocksdb +.} + ## ## Returns the rocksdb_level_metadata_t of the ith level from the specified ## column family metadata. @@ -2553,9 +4742,13 @@ proc rocksdb_column_family_metadata_get_level_count*( ## proc rocksdb_column_family_metadata_get_level_metadata*( - cf_meta: ptr rocksdb_column_family_metadata_t; i: csize_t): ptr rocksdb_level_metadata_t {. - cdecl, importc: "rocksdb_column_family_metadata_get_level_metadata", - dynlib: librocksdb.} + cf_meta: ptr rocksdb_column_family_metadata_t, i: csize_t +): ptr rocksdb_level_metadata_t {. + cdecl, + importc: "rocksdb_column_family_metadata_get_level_metadata", + dynlib: librocksdb +.} + ## ## Releases the specified rocksdb_level_metadata_t. ## @@ -2563,15 +4756,24 @@ proc rocksdb_column_family_metadata_get_level_metadata*( ## before the release of its parent rocksdb_column_family_metadata_t. ## -proc rocksdb_level_metadata_destroy*(level_meta: ptr rocksdb_level_metadata_t) {. - cdecl, importc: "rocksdb_level_metadata_destroy", dynlib: librocksdb.} -proc rocksdb_level_metadata_get_level*(level_meta: ptr rocksdb_level_metadata_t): cint {. - cdecl, importc: "rocksdb_level_metadata_get_level", dynlib: librocksdb.} -proc rocksdb_level_metadata_get_size*(level_meta: ptr rocksdb_level_metadata_t): uint64 {. - cdecl, importc: "rocksdb_level_metadata_get_size", dynlib: librocksdb.} +proc rocksdb_level_metadata_destroy*( + level_meta: ptr rocksdb_level_metadata_t +) {.cdecl, importc: "rocksdb_level_metadata_destroy", dynlib: librocksdb.} + +proc rocksdb_level_metadata_get_level*( + level_meta: ptr rocksdb_level_metadata_t +): cint {.cdecl, importc: "rocksdb_level_metadata_get_level", dynlib: librocksdb.} + +proc rocksdb_level_metadata_get_size*( + level_meta: ptr rocksdb_level_metadata_t +): uint64 {.cdecl, importc: "rocksdb_level_metadata_get_size", dynlib: librocksdb.} + proc rocksdb_level_metadata_get_file_count*( - level_meta: ptr rocksdb_level_metadata_t): csize_t {.cdecl, - importc: "rocksdb_level_metadata_get_file_count", dynlib: librocksdb.} + level_meta: ptr rocksdb_level_metadata_t +): csize_t {. + cdecl, importc: "rocksdb_level_metadata_get_file_count", dynlib: librocksdb +.} + ## ## Returns the sst_file_metadata_t of the ith file from the specified level ## metadata. @@ -2585,9 +4787,11 @@ proc rocksdb_level_metadata_get_file_count*( ## proc rocksdb_level_metadata_get_sst_file_metadata*( - level_meta: ptr rocksdb_level_metadata_t; i: csize_t): ptr rocksdb_sst_file_metadata_t {. - cdecl, importc: "rocksdb_level_metadata_get_sst_file_metadata", - dynlib: librocksdb.} + level_meta: ptr rocksdb_level_metadata_t, i: csize_t +): ptr rocksdb_sst_file_metadata_t {. + cdecl, importc: "rocksdb_level_metadata_get_sst_file_metadata", dynlib: librocksdb +.} + ## ## Releases the specified rocksdb_sst_file_metadata_t. ## @@ -2595,16 +4799,26 @@ proc rocksdb_level_metadata_get_sst_file_metadata*( ## before the release of its parent rocksdb_level_metadata_t. ## -proc rocksdb_sst_file_metadata_destroy*(file_meta: ptr rocksdb_sst_file_metadata_t) {. - cdecl, importc: "rocksdb_sst_file_metadata_destroy", dynlib: librocksdb.} +proc rocksdb_sst_file_metadata_destroy*( + file_meta: ptr rocksdb_sst_file_metadata_t +) {.cdecl, importc: "rocksdb_sst_file_metadata_destroy", dynlib: librocksdb.} + proc rocksdb_sst_file_metadata_get_relative_filename*( - file_meta: ptr rocksdb_sst_file_metadata_t): cstring {.cdecl, - importc: "rocksdb_sst_file_metadata_get_relative_filename", dynlib: librocksdb.} + file_meta: ptr rocksdb_sst_file_metadata_t +): cstring {. + cdecl, importc: "rocksdb_sst_file_metadata_get_relative_filename", dynlib: librocksdb +.} + proc rocksdb_sst_file_metadata_get_directory*( - file_meta: ptr rocksdb_sst_file_metadata_t): cstring {.cdecl, - importc: "rocksdb_sst_file_metadata_get_directory", dynlib: librocksdb.} -proc rocksdb_sst_file_metadata_get_size*(file_meta: ptr rocksdb_sst_file_metadata_t): uint64 {. - cdecl, importc: "rocksdb_sst_file_metadata_get_size", dynlib: librocksdb.} + file_meta: ptr rocksdb_sst_file_metadata_t +): cstring {. + cdecl, importc: "rocksdb_sst_file_metadata_get_directory", dynlib: librocksdb +.} + +proc rocksdb_sst_file_metadata_get_size*( + file_meta: ptr rocksdb_sst_file_metadata_t +): uint64 {.cdecl, importc: "rocksdb_sst_file_metadata_get_size", dynlib: librocksdb.} + ## ## Returns the smallest key of the specified sst file. ## The caller is responsible for releasing the returned memory. @@ -2615,8 +4829,11 @@ proc rocksdb_sst_file_metadata_get_size*(file_meta: ptr rocksdb_sst_file_metadat ## proc rocksdb_sst_file_metadata_get_smallestkey*( - file_meta: ptr rocksdb_sst_file_metadata_t; len: ptr csize_t): cstring {.cdecl, - importc: "rocksdb_sst_file_metadata_get_smallestkey", dynlib: librocksdb.} + file_meta: ptr rocksdb_sst_file_metadata_t, len: ptr csize_t +): cstring {. + cdecl, importc: "rocksdb_sst_file_metadata_get_smallestkey", dynlib: librocksdb +.} + ## ## Returns the smallest key of the specified sst file. ## The caller is responsible for releasing the returned memory. @@ -2627,516 +4844,943 @@ proc rocksdb_sst_file_metadata_get_smallestkey*( ## proc rocksdb_sst_file_metadata_get_largestkey*( - file_meta: ptr rocksdb_sst_file_metadata_t; len: ptr csize_t): cstring {.cdecl, - importc: "rocksdb_sst_file_metadata_get_largestkey", dynlib: librocksdb.} + file_meta: ptr rocksdb_sst_file_metadata_t, len: ptr csize_t +): cstring {. + cdecl, importc: "rocksdb_sst_file_metadata_get_largestkey", dynlib: librocksdb +.} + ## Transactions proc rocksdb_transactiondb_create_column_family*( - txn_db: ptr rocksdb_transactiondb_t; - column_family_options: ptr rocksdb_options_t; column_family_name: cstring; - errptr: cstringArray): ptr rocksdb_column_family_handle_t {.cdecl, - importc: "rocksdb_transactiondb_create_column_family", dynlib: librocksdb.} -proc rocksdb_transactiondb_open*(options: ptr rocksdb_options_t; txn_db_options: ptr rocksdb_transactiondb_options_t; - name: cstring; errptr: cstringArray): ptr rocksdb_transactiondb_t {. - cdecl, importc: "rocksdb_transactiondb_open", dynlib: librocksdb.} -proc rocksdb_transactiondb_open_column_families*(options: ptr rocksdb_options_t; - txn_db_options: ptr rocksdb_transactiondb_options_t; name: cstring; - num_column_families: cint; column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_transactiondb_t {.cdecl, - importc: "rocksdb_transactiondb_open_column_families", dynlib: librocksdb.} -proc rocksdb_transactiondb_create_snapshot*(txn_db: ptr rocksdb_transactiondb_t): ptr rocksdb_snapshot_t {. - cdecl, importc: "rocksdb_transactiondb_create_snapshot", dynlib: librocksdb.} -proc rocksdb_transactiondb_release_snapshot*(txn_db: ptr rocksdb_transactiondb_t; - snapshot: ptr rocksdb_snapshot_t) {.cdecl, importc: "rocksdb_transactiondb_release_snapshot", - dynlib: librocksdb.} -proc rocksdb_transactiondb_property_value*(db: ptr rocksdb_transactiondb_t; - propname: cstring): cstring {.cdecl, - importc: "rocksdb_transactiondb_property_value", - dynlib: librocksdb.} -proc rocksdb_transactiondb_property_int*(db: ptr rocksdb_transactiondb_t; - propname: cstring; out_val: ptr uint64): cint {. - cdecl, importc: "rocksdb_transactiondb_property_int", dynlib: librocksdb.} -proc rocksdb_transactiondb_get_base_db*(txn_db: ptr rocksdb_transactiondb_t): ptr rocksdb_t {. - cdecl, importc: "rocksdb_transactiondb_get_base_db", dynlib: librocksdb.} -proc rocksdb_transactiondb_close_base_db*(base_db: ptr rocksdb_t) {.cdecl, - importc: "rocksdb_transactiondb_close_base_db", dynlib: librocksdb.} -proc rocksdb_transaction_begin*(txn_db: ptr rocksdb_transactiondb_t; - write_options: ptr rocksdb_writeoptions_t; - txn_options: ptr rocksdb_transaction_options_t; - old_txn: ptr rocksdb_transaction_t): ptr rocksdb_transaction_t {. - cdecl, importc: "rocksdb_transaction_begin", dynlib: librocksdb.} + txn_db: ptr rocksdb_transactiondb_t, + column_family_options: ptr rocksdb_options_t, + column_family_name: cstring, + errptr: cstringArray, +): ptr rocksdb_column_family_handle_t {. + cdecl, importc: "rocksdb_transactiondb_create_column_family", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_open*( + options: ptr rocksdb_options_t, + txn_db_options: ptr rocksdb_transactiondb_options_t, + name: cstring, + errptr: cstringArray, +): ptr rocksdb_transactiondb_t {. + cdecl, importc: "rocksdb_transactiondb_open", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_open_column_families*( + options: ptr rocksdb_options_t, + txn_db_options: ptr rocksdb_transactiondb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_transactiondb_t {. + cdecl, importc: "rocksdb_transactiondb_open_column_families", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_create_snapshot*( + txn_db: ptr rocksdb_transactiondb_t +): ptr rocksdb_snapshot_t {. + cdecl, importc: "rocksdb_transactiondb_create_snapshot", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_release_snapshot*( + txn_db: ptr rocksdb_transactiondb_t, snapshot: ptr rocksdb_snapshot_t +) {.cdecl, importc: "rocksdb_transactiondb_release_snapshot", dynlib: librocksdb.} + +proc rocksdb_transactiondb_property_value*( + db: ptr rocksdb_transactiondb_t, propname: cstring +): cstring {. + cdecl, importc: "rocksdb_transactiondb_property_value", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_property_int*( + db: ptr rocksdb_transactiondb_t, propname: cstring, out_val: ptr uint64 +): cint {.cdecl, importc: "rocksdb_transactiondb_property_int", dynlib: librocksdb.} + +proc rocksdb_transactiondb_get_base_db*( + txn_db: ptr rocksdb_transactiondb_t +): ptr rocksdb_t {. + cdecl, importc: "rocksdb_transactiondb_get_base_db", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_close_base_db*( + base_db: ptr rocksdb_t +) {.cdecl, importc: "rocksdb_transactiondb_close_base_db", dynlib: librocksdb.} + +proc rocksdb_transaction_begin*( + txn_db: ptr rocksdb_transactiondb_t, + write_options: ptr rocksdb_writeoptions_t, + txn_options: ptr rocksdb_transaction_options_t, + old_txn: ptr rocksdb_transaction_t, +): ptr rocksdb_transaction_t {. + cdecl, importc: "rocksdb_transaction_begin", dynlib: librocksdb +.} + proc rocksdb_transactiondb_get_prepared_transactions*( - txn_db: ptr rocksdb_transactiondb_t; cnt: ptr csize_t): ptr ptr rocksdb_transaction_t {. - cdecl, importc: "rocksdb_transactiondb_get_prepared_transactions", - dynlib: librocksdb.} -proc rocksdb_transaction_set_name*(txn: ptr rocksdb_transaction_t; name: cstring; - name_len: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_set_name", dynlib: librocksdb.} -proc rocksdb_transaction_get_name*(txn: ptr rocksdb_transaction_t; - name_len: ptr csize_t): cstring {.cdecl, - importc: "rocksdb_transaction_get_name", dynlib: librocksdb.} -proc rocksdb_transaction_prepare*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_prepare", dynlib: librocksdb.} -proc rocksdb_transaction_commit*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_commit", dynlib: librocksdb.} -proc rocksdb_transaction_rollback*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_rollback", dynlib: librocksdb.} -proc rocksdb_transaction_set_savepoint*(txn: ptr rocksdb_transaction_t) {.cdecl, - importc: "rocksdb_transaction_set_savepoint", dynlib: librocksdb.} -proc rocksdb_transaction_rollback_to_savepoint*(txn: ptr rocksdb_transaction_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_rollback_to_savepoint", - dynlib: librocksdb.} -proc rocksdb_transaction_destroy*(txn: ptr rocksdb_transaction_t) {.cdecl, - importc: "rocksdb_transaction_destroy", dynlib: librocksdb.} -proc rocksdb_transaction_get_writebatch_wi*(txn: ptr rocksdb_transaction_t): ptr rocksdb_writebatch_wi_t {. - cdecl, importc: "rocksdb_transaction_get_writebatch_wi", dynlib: librocksdb.} -proc rocksdb_transaction_rebuild_from_writebatch*(txn: ptr rocksdb_transaction_t; - writebatch: ptr rocksdb_writebatch_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_rebuild_from_writebatch", dynlib: librocksdb.} + txn_db: ptr rocksdb_transactiondb_t, cnt: ptr csize_t +): ptr ptr rocksdb_transaction_t {. + cdecl, importc: "rocksdb_transactiondb_get_prepared_transactions", dynlib: librocksdb +.} + +proc rocksdb_transaction_set_name*( + txn: ptr rocksdb_transaction_t, name: cstring, name_len: csize_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transaction_set_name", dynlib: librocksdb.} + +proc rocksdb_transaction_get_name*( + txn: ptr rocksdb_transaction_t, name_len: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_transaction_get_name", dynlib: librocksdb.} + +proc rocksdb_transaction_prepare*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transaction_prepare", dynlib: librocksdb.} + +proc rocksdb_transaction_commit*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transaction_commit", dynlib: librocksdb.} + +proc rocksdb_transaction_rollback*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transaction_rollback", dynlib: librocksdb.} + +proc rocksdb_transaction_set_savepoint*( + txn: ptr rocksdb_transaction_t +) {.cdecl, importc: "rocksdb_transaction_set_savepoint", dynlib: librocksdb.} + +proc rocksdb_transaction_rollback_to_savepoint*( + txn: ptr rocksdb_transaction_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transaction_rollback_to_savepoint", dynlib: librocksdb.} + +proc rocksdb_transaction_destroy*( + txn: ptr rocksdb_transaction_t +) {.cdecl, importc: "rocksdb_transaction_destroy", dynlib: librocksdb.} + +proc rocksdb_transaction_get_writebatch_wi*( + txn: ptr rocksdb_transaction_t +): ptr rocksdb_writebatch_wi_t {. + cdecl, importc: "rocksdb_transaction_get_writebatch_wi", dynlib: librocksdb +.} + +proc rocksdb_transaction_rebuild_from_writebatch*( + txn: ptr rocksdb_transaction_t, + writebatch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_rebuild_from_writebatch", dynlib: librocksdb.} + ## This rocksdb_writebatch_wi_t should be freed with rocksdb_free proc rocksdb_transaction_rebuild_from_writebatch_wi*( - txn: ptr rocksdb_transaction_t; wi: ptr rocksdb_writebatch_wi_t; - errptr: cstringArray) {.cdecl, importc: "rocksdb_transaction_rebuild_from_writebatch_wi", - dynlib: librocksdb.} -proc rocksdb_transaction_set_commit_timestamp*(txn: ptr rocksdb_transaction_t; - commit_timestamp: uint64) {.cdecl, importc: "rocksdb_transaction_set_commit_timestamp", - dynlib: librocksdb.} + txn: ptr rocksdb_transaction_t, wi: ptr rocksdb_writebatch_wi_t, errptr: cstringArray +) {. + cdecl, importc: "rocksdb_transaction_rebuild_from_writebatch_wi", dynlib: librocksdb +.} + +proc rocksdb_transaction_set_commit_timestamp*( + txn: ptr rocksdb_transaction_t, commit_timestamp: uint64 +) {.cdecl, importc: "rocksdb_transaction_set_commit_timestamp", dynlib: librocksdb.} + proc rocksdb_transaction_set_read_timestamp_for_validation*( - txn: ptr rocksdb_transaction_t; read_timestamp: uint64) {.cdecl, - importc: "rocksdb_transaction_set_read_timestamp_for_validation", - dynlib: librocksdb.} + txn: ptr rocksdb_transaction_t, read_timestamp: uint64 +) {. + cdecl, + importc: "rocksdb_transaction_set_read_timestamp_for_validation", + dynlib: librocksdb +.} + ## This snapshot should be freed using rocksdb_free -proc rocksdb_transaction_get_snapshot*(txn: ptr rocksdb_transaction_t): ptr rocksdb_snapshot_t {. - cdecl, importc: "rocksdb_transaction_get_snapshot", dynlib: librocksdb.} -proc rocksdb_transaction_get*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; key: cstring; - klen: csize_t; vlen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl, importc: "rocksdb_transaction_get", dynlib: librocksdb.} -proc rocksdb_transaction_get_pinned*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - key: cstring; klen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transaction_get_pinned", dynlib: librocksdb.} -proc rocksdb_transaction_get_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; vlen: ptr csize_t; - errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_transaction_get_cf", dynlib: librocksdb.} -proc rocksdb_transaction_get_pinned_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transaction_get_pinned_cf", dynlib: librocksdb.} -proc rocksdb_transaction_get_for_update*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - key: cstring; klen: csize_t; - vlen: ptr csize_t; exclusive: uint8; - errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_transaction_get_for_update", dynlib: librocksdb.} -proc rocksdb_transaction_get_pinned_for_update*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; key: cstring; klen: csize_t; exclusive: uint8; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl, - importc: "rocksdb_transaction_get_pinned_for_update", dynlib: librocksdb.} -proc rocksdb_transaction_get_for_update_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - vlen: ptr csize_t; exclusive: uint8; errptr: cstringArray): cstring {.cdecl, - importc: "rocksdb_transaction_get_for_update_cf", dynlib: librocksdb.} +proc rocksdb_transaction_get_snapshot*( + txn: ptr rocksdb_transaction_t +): ptr rocksdb_snapshot_t {. + cdecl, importc: "rocksdb_transaction_get_snapshot", dynlib: librocksdb +.} + +proc rocksdb_transaction_get*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_transaction_get", dynlib: librocksdb.} + +proc rocksdb_transaction_get_pinned*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_transaction_get_pinned", dynlib: librocksdb +.} + +proc rocksdb_transaction_get_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_transaction_get_cf", dynlib: librocksdb.} + +proc rocksdb_transaction_get_pinned_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_transaction_get_pinned_cf", dynlib: librocksdb +.} + +proc rocksdb_transaction_get_for_update*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + exclusive: uint8, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_transaction_get_for_update", dynlib: librocksdb.} + +proc rocksdb_transaction_get_pinned_for_update*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + exclusive: uint8, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_transaction_get_pinned_for_update", dynlib: librocksdb +.} + +proc rocksdb_transaction_get_for_update_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + exclusive: uint8, + errptr: cstringArray, +): cstring {. + cdecl, importc: "rocksdb_transaction_get_for_update_cf", dynlib: librocksdb +.} + proc rocksdb_transaction_get_pinned_for_update_cf*( - txn: ptr rocksdb_transaction_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - exclusive: uint8; errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl, - importc: "rocksdb_transaction_get_pinned_for_update_cf", dynlib: librocksdb.} -proc rocksdb_transaction_multi_get*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl, - importc: "rocksdb_transaction_multi_get", dynlib: librocksdb.} -proc rocksdb_transaction_multi_get_for_update*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl, - importc: "rocksdb_transaction_multi_get_for_update", dynlib: librocksdb.} -proc rocksdb_transaction_multi_get_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl, - importc: "rocksdb_transaction_multi_get_cf", dynlib: librocksdb.} -proc rocksdb_transaction_multi_get_for_update_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; keys_list_sizes: ptr csize_t; values_list: cstringArray; - values_list_sizes: ptr csize_t; errs: cstringArray) {.cdecl, - importc: "rocksdb_transaction_multi_get_for_update_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_get*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; key: cstring; - klen: csize_t; vlen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl, importc: "rocksdb_transactiondb_get", dynlib: librocksdb.} -proc rocksdb_transactiondb_get_pinned*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - key: cstring; klen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_transactiondb_get_pinned", dynlib: librocksdb.} -proc rocksdb_transactiondb_get_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; - vallen: ptr csize_t; errptr: cstringArray): cstring {. - cdecl, importc: "rocksdb_transactiondb_get_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_get_pinned_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - errptr: cstringArray): ptr rocksdb_pinnableslice_t {.cdecl, - importc: "rocksdb_transactiondb_get_pinned_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_multi_get*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - num_keys: csize_t; keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_multi_get", dynlib: librocksdb.} -proc rocksdb_transactiondb_multi_get_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; num_keys: csize_t; - keys_list: cstringArray; - keys_list_sizes: ptr csize_t; - values_list: cstringArray; - values_list_sizes: ptr csize_t; - errs: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_multi_get_cf", dynlib: librocksdb.} -proc rocksdb_transaction_put*(txn: ptr rocksdb_transaction_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_put", dynlib: librocksdb.} -proc rocksdb_transaction_put_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_put_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_put*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_put", dynlib: librocksdb.} -proc rocksdb_transactiondb_put_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - val: cstring; vallen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_put_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_write*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - batch: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_write", dynlib: librocksdb.} -proc rocksdb_transaction_merge*(txn: ptr rocksdb_transaction_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_merge", dynlib: librocksdb.} -proc rocksdb_transaction_merge_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; val: cstring; - vlen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_merge_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_merge*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; key: cstring; - klen: csize_t; val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_merge", dynlib: librocksdb.} -proc rocksdb_transactiondb_merge_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; klen: csize_t; - val: cstring; vlen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_merge_cf", dynlib: librocksdb.} -proc rocksdb_transaction_delete*(txn: ptr rocksdb_transaction_t; key: cstring; - klen: csize_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transaction_delete", dynlib: librocksdb.} -proc rocksdb_transaction_delete_cf*(txn: ptr rocksdb_transaction_t; column_family: ptr rocksdb_column_family_handle_t; - key: cstring; klen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_transaction_delete_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_delete*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - key: cstring; klen: csize_t; errptr: cstringArray) {. - cdecl, importc: "rocksdb_transactiondb_delete", dynlib: librocksdb.} -proc rocksdb_transactiondb_delete_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_writeoptions_t; - column_family: ptr rocksdb_column_family_handle_t; key: cstring; keylen: csize_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_delete_cf", dynlib: librocksdb.} -proc rocksdb_transaction_create_iterator*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {.cdecl, - importc: "rocksdb_transaction_create_iterator", dynlib: librocksdb.} -proc rocksdb_transaction_create_iterator_cf*(txn: ptr rocksdb_transaction_t; - options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_transaction_create_iterator_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_create_iterator*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_readoptions_t): ptr rocksdb_iterator_t {.cdecl, - importc: "rocksdb_transactiondb_create_iterator", dynlib: librocksdb.} + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + exclusive: uint8, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_transaction_get_pinned_for_update_cf", dynlib: librocksdb +.} + +proc rocksdb_transaction_multi_get*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_multi_get", dynlib: librocksdb.} + +proc rocksdb_transaction_multi_get_for_update*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_multi_get_for_update", dynlib: librocksdb.} + +proc rocksdb_transaction_multi_get_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_multi_get_cf", dynlib: librocksdb.} + +proc rocksdb_transaction_multi_get_for_update_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_multi_get_for_update_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_get*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + vlen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_transactiondb_get", dynlib: librocksdb.} + +proc rocksdb_transactiondb_get_pinned*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_transactiondb_get_pinned", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_get_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + vallen: ptr csize_t, + errptr: cstringArray, +): cstring {.cdecl, importc: "rocksdb_transactiondb_get_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_get_pinned_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_transactiondb_get_pinned_cf", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_multi_get*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_multi_get", dynlib: librocksdb.} + +proc rocksdb_transactiondb_multi_get_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_keys: csize_t, + keys_list: cstringArray, + keys_list_sizes: ptr csize_t, + values_list: cstringArray, + values_list_sizes: ptr csize_t, + errs: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_multi_get_cf", dynlib: librocksdb.} + +proc rocksdb_transaction_put*( + txn: ptr rocksdb_transaction_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_put", dynlib: librocksdb.} + +proc rocksdb_transaction_put_cf*( + txn: ptr rocksdb_transaction_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_put_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_put*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_put", dynlib: librocksdb.} + +proc rocksdb_transactiondb_put_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + val: cstring, + vallen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_put_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_write*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + batch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_write", dynlib: librocksdb.} + +proc rocksdb_transaction_merge*( + txn: ptr rocksdb_transaction_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_merge", dynlib: librocksdb.} + +proc rocksdb_transaction_merge_cf*( + txn: ptr rocksdb_transaction_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_merge_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_merge*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_merge", dynlib: librocksdb.} + +proc rocksdb_transactiondb_merge_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + val: cstring, + vlen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_merge_cf", dynlib: librocksdb.} + +proc rocksdb_transaction_delete*( + txn: ptr rocksdb_transaction_t, key: cstring, klen: csize_t, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transaction_delete", dynlib: librocksdb.} + +proc rocksdb_transaction_delete_cf*( + txn: ptr rocksdb_transaction_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transaction_delete_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_delete*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + key: cstring, + klen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_delete", dynlib: librocksdb.} + +proc rocksdb_transactiondb_delete_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_writeoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_delete_cf", dynlib: librocksdb.} + +proc rocksdb_transaction_create_iterator*( + txn: ptr rocksdb_transaction_t, options: ptr rocksdb_readoptions_t +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_transaction_create_iterator", dynlib: librocksdb +.} + +proc rocksdb_transaction_create_iterator_cf*( + txn: ptr rocksdb_transaction_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_transaction_create_iterator_cf", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_create_iterator*( + txn_db: ptr rocksdb_transactiondb_t, options: ptr rocksdb_readoptions_t +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_transactiondb_create_iterator", dynlib: librocksdb +.} + proc rocksdb_transactiondb_create_iterator_cf*( - txn_db: ptr rocksdb_transactiondb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t): ptr rocksdb_iterator_t {. - cdecl, importc: "rocksdb_transactiondb_create_iterator_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_close*(txn_db: ptr rocksdb_transactiondb_t) {.cdecl, - importc: "rocksdb_transactiondb_close", dynlib: librocksdb.} -proc rocksdb_transactiondb_flush*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_flushoptions_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_flush", dynlib: librocksdb.} -proc rocksdb_transactiondb_flush_cf*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_flushoptions_t; - column_family: ptr rocksdb_column_family_handle_t; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_flush_cf", dynlib: librocksdb.} -proc rocksdb_transactiondb_flush_cfs*(txn_db: ptr rocksdb_transactiondb_t; - options: ptr rocksdb_flushoptions_t; - column_families: ptr ptr rocksdb_column_family_handle_t; - num_column_families: cint; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_flush_cfs", dynlib: librocksdb.} -proc rocksdb_transactiondb_flush_wal*(txn_db: ptr rocksdb_transactiondb_t; - sync: uint8; errptr: cstringArray) {.cdecl, - importc: "rocksdb_transactiondb_flush_wal", dynlib: librocksdb.} + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, +): ptr rocksdb_iterator_t {. + cdecl, importc: "rocksdb_transactiondb_create_iterator_cf", dynlib: librocksdb +.} + +proc rocksdb_transactiondb_close*( + txn_db: ptr rocksdb_transactiondb_t +) {.cdecl, importc: "rocksdb_transactiondb_close", dynlib: librocksdb.} + +proc rocksdb_transactiondb_flush*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_flushoptions_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_flush", dynlib: librocksdb.} + +proc rocksdb_transactiondb_flush_cf*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_flushoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_flush_cf", dynlib: librocksdb.} + +proc rocksdb_transactiondb_flush_cfs*( + txn_db: ptr rocksdb_transactiondb_t, + options: ptr rocksdb_flushoptions_t, + column_families: ptr ptr rocksdb_column_family_handle_t, + num_column_families: cint, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_transactiondb_flush_cfs", dynlib: librocksdb.} + +proc rocksdb_transactiondb_flush_wal*( + txn_db: ptr rocksdb_transactiondb_t, sync: uint8, errptr: cstringArray +) {.cdecl, importc: "rocksdb_transactiondb_flush_wal", dynlib: librocksdb.} + proc rocksdb_transactiondb_checkpoint_object_create*( - txn_db: ptr rocksdb_transactiondb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. - cdecl, importc: "rocksdb_transactiondb_checkpoint_object_create", - dynlib: librocksdb.} -proc rocksdb_optimistictransactiondb_open*(options: ptr rocksdb_options_t; - name: cstring; errptr: cstringArray): ptr rocksdb_optimistictransactiondb_t {. - cdecl, importc: "rocksdb_optimistictransactiondb_open", dynlib: librocksdb.} + txn_db: ptr rocksdb_transactiondb_t, errptr: cstringArray +): ptr rocksdb_checkpoint_t {. + cdecl, importc: "rocksdb_transactiondb_checkpoint_object_create", dynlib: librocksdb +.} + +proc rocksdb_optimistictransactiondb_open*( + options: ptr rocksdb_options_t, name: cstring, errptr: cstringArray +): ptr rocksdb_optimistictransactiondb_t {. + cdecl, importc: "rocksdb_optimistictransactiondb_open", dynlib: librocksdb +.} + proc rocksdb_optimistictransactiondb_open_column_families*( - options: ptr rocksdb_options_t; name: cstring; num_column_families: cint; - column_family_names: cstringArray; - column_family_options: ptr ptr rocksdb_options_t; - column_family_handles: ptr ptr rocksdb_column_family_handle_t; - errptr: cstringArray): ptr rocksdb_optimistictransactiondb_t {.cdecl, - importc: "rocksdb_optimistictransactiondb_open_column_families", - dynlib: librocksdb.} + options: ptr rocksdb_options_t, + name: cstring, + num_column_families: cint, + column_family_names: cstringArray, + column_family_options: ptr ptr rocksdb_options_t, + column_family_handles: ptr ptr rocksdb_column_family_handle_t, + errptr: cstringArray, +): ptr rocksdb_optimistictransactiondb_t {. + cdecl, + importc: "rocksdb_optimistictransactiondb_open_column_families", + dynlib: librocksdb +.} + proc rocksdb_optimistictransactiondb_get_base_db*( - otxn_db: ptr rocksdb_optimistictransactiondb_t): ptr rocksdb_t {.cdecl, - importc: "rocksdb_optimistictransactiondb_get_base_db", dynlib: librocksdb.} -proc rocksdb_optimistictransactiondb_close_base_db*(base_db: ptr rocksdb_t) {.cdecl, - importc: "rocksdb_optimistictransactiondb_close_base_db", dynlib: librocksdb.} + otxn_db: ptr rocksdb_optimistictransactiondb_t +): ptr rocksdb_t {. + cdecl, importc: "rocksdb_optimistictransactiondb_get_base_db", dynlib: librocksdb +.} + +proc rocksdb_optimistictransactiondb_close_base_db*( + base_db: ptr rocksdb_t +) {. + cdecl, importc: "rocksdb_optimistictransactiondb_close_base_db", dynlib: librocksdb +.} + proc rocksdb_optimistictransaction_begin*( - otxn_db: ptr rocksdb_optimistictransactiondb_t; - write_options: ptr rocksdb_writeoptions_t; - otxn_options: ptr rocksdb_optimistictransaction_options_t; - old_txn: ptr rocksdb_transaction_t): ptr rocksdb_transaction_t {.cdecl, - importc: "rocksdb_optimistictransaction_begin", dynlib: librocksdb.} + otxn_db: ptr rocksdb_optimistictransactiondb_t, + write_options: ptr rocksdb_writeoptions_t, + otxn_options: ptr rocksdb_optimistictransaction_options_t, + old_txn: ptr rocksdb_transaction_t, +): ptr rocksdb_transaction_t {. + cdecl, importc: "rocksdb_optimistictransaction_begin", dynlib: librocksdb +.} + proc rocksdb_optimistictransactiondb_write*( - otxn_db: ptr rocksdb_optimistictransactiondb_t; - options: ptr rocksdb_writeoptions_t; batch: ptr rocksdb_writebatch_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_optimistictransactiondb_write", - dynlib: librocksdb.} + otxn_db: ptr rocksdb_optimistictransactiondb_t, + options: ptr rocksdb_writeoptions_t, + batch: ptr rocksdb_writebatch_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_optimistictransactiondb_write", dynlib: librocksdb.} + proc rocksdb_optimistictransactiondb_close*( - otxn_db: ptr rocksdb_optimistictransactiondb_t) {.cdecl, - importc: "rocksdb_optimistictransactiondb_close", dynlib: librocksdb.} + otxn_db: ptr rocksdb_optimistictransactiondb_t +) {.cdecl, importc: "rocksdb_optimistictransactiondb_close", dynlib: librocksdb.} + proc rocksdb_optimistictransactiondb_checkpoint_object_create*( - otxn_db: ptr rocksdb_optimistictransactiondb_t; errptr: cstringArray): ptr rocksdb_checkpoint_t {. - cdecl, importc: "rocksdb_optimistictransactiondb_checkpoint_object_create", - dynlib: librocksdb.} + otxn_db: ptr rocksdb_optimistictransactiondb_t, errptr: cstringArray +): ptr rocksdb_checkpoint_t {. + cdecl, + importc: "rocksdb_optimistictransactiondb_checkpoint_object_create", + dynlib: librocksdb +.} + ## Transaction Options proc rocksdb_transactiondb_options_create*(): ptr rocksdb_transactiondb_options_t {. - cdecl, importc: "rocksdb_transactiondb_options_create", dynlib: librocksdb.} + cdecl, importc: "rocksdb_transactiondb_options_create", dynlib: librocksdb +.} + proc rocksdb_transactiondb_options_destroy*( - opt: ptr rocksdb_transactiondb_options_t) {.cdecl, - importc: "rocksdb_transactiondb_options_destroy", dynlib: librocksdb.} + opt: ptr rocksdb_transactiondb_options_t +) {.cdecl, importc: "rocksdb_transactiondb_options_destroy", dynlib: librocksdb.} + proc rocksdb_transactiondb_options_set_max_num_locks*( - opt: ptr rocksdb_transactiondb_options_t; max_num_locks: int64) {.cdecl, - importc: "rocksdb_transactiondb_options_set_max_num_locks", dynlib: librocksdb.} + opt: ptr rocksdb_transactiondb_options_t, max_num_locks: int64 +) {. + cdecl, importc: "rocksdb_transactiondb_options_set_max_num_locks", dynlib: librocksdb +.} + proc rocksdb_transactiondb_options_set_num_stripes*( - opt: ptr rocksdb_transactiondb_options_t; num_stripes: csize_t) {.cdecl, - importc: "rocksdb_transactiondb_options_set_num_stripes", dynlib: librocksdb.} + opt: ptr rocksdb_transactiondb_options_t, num_stripes: csize_t +) {. + cdecl, importc: "rocksdb_transactiondb_options_set_num_stripes", dynlib: librocksdb +.} + proc rocksdb_transactiondb_options_set_transaction_lock_timeout*( - opt: ptr rocksdb_transactiondb_options_t; txn_lock_timeout: int64) {.cdecl, - importc: "rocksdb_transactiondb_options_set_transaction_lock_timeout", - dynlib: librocksdb.} + opt: ptr rocksdb_transactiondb_options_t, txn_lock_timeout: int64 +) {. + cdecl, + importc: "rocksdb_transactiondb_options_set_transaction_lock_timeout", + dynlib: librocksdb +.} + proc rocksdb_transactiondb_options_set_default_lock_timeout*( - opt: ptr rocksdb_transactiondb_options_t; default_lock_timeout: int64) {.cdecl, - importc: "rocksdb_transactiondb_options_set_default_lock_timeout", - dynlib: librocksdb.} + opt: ptr rocksdb_transactiondb_options_t, default_lock_timeout: int64 +) {. + cdecl, + importc: "rocksdb_transactiondb_options_set_default_lock_timeout", + dynlib: librocksdb +.} + proc rocksdb_transaction_options_create*(): ptr rocksdb_transaction_options_t {. - cdecl, importc: "rocksdb_transaction_options_create", dynlib: librocksdb.} -proc rocksdb_transaction_options_destroy*(opt: ptr rocksdb_transaction_options_t) {. - cdecl, importc: "rocksdb_transaction_options_destroy", dynlib: librocksdb.} + cdecl, importc: "rocksdb_transaction_options_create", dynlib: librocksdb +.} + +proc rocksdb_transaction_options_destroy*( + opt: ptr rocksdb_transaction_options_t +) {.cdecl, importc: "rocksdb_transaction_options_destroy", dynlib: librocksdb.} + proc rocksdb_transaction_options_set_set_snapshot*( - opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl, - importc: "rocksdb_transaction_options_set_set_snapshot", dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, v: uint8 +) {.cdecl, importc: "rocksdb_transaction_options_set_set_snapshot", dynlib: librocksdb.} + proc rocksdb_transaction_options_set_deadlock_detect*( - opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl, - importc: "rocksdb_transaction_options_set_deadlock_detect", dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, v: uint8 +) {. + cdecl, importc: "rocksdb_transaction_options_set_deadlock_detect", dynlib: librocksdb +.} + proc rocksdb_transaction_options_set_lock_timeout*( - opt: ptr rocksdb_transaction_options_t; lock_timeout: int64) {.cdecl, - importc: "rocksdb_transaction_options_set_lock_timeout", dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, lock_timeout: int64 +) {.cdecl, importc: "rocksdb_transaction_options_set_lock_timeout", dynlib: librocksdb.} + proc rocksdb_transaction_options_set_expiration*( - opt: ptr rocksdb_transaction_options_t; expiration: int64) {.cdecl, - importc: "rocksdb_transaction_options_set_expiration", dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, expiration: int64 +) {.cdecl, importc: "rocksdb_transaction_options_set_expiration", dynlib: librocksdb.} + proc rocksdb_transaction_options_set_deadlock_detect_depth*( - opt: ptr rocksdb_transaction_options_t; depth: int64) {.cdecl, - importc: "rocksdb_transaction_options_set_deadlock_detect_depth", - dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, depth: int64 +) {. + cdecl, + importc: "rocksdb_transaction_options_set_deadlock_detect_depth", + dynlib: librocksdb +.} + proc rocksdb_transaction_options_set_max_write_batch_size*( - opt: ptr rocksdb_transaction_options_t; size: csize_t) {.cdecl, - importc: "rocksdb_transaction_options_set_max_write_batch_size", - dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, size: csize_t +) {. + cdecl, + importc: "rocksdb_transaction_options_set_max_write_batch_size", + dynlib: librocksdb +.} + proc rocksdb_transaction_options_set_skip_prepare*( - opt: ptr rocksdb_transaction_options_t; v: uint8) {.cdecl, - importc: "rocksdb_transaction_options_set_skip_prepare", dynlib: librocksdb.} + opt: ptr rocksdb_transaction_options_t, v: uint8 +) {.cdecl, importc: "rocksdb_transaction_options_set_skip_prepare", dynlib: librocksdb.} + proc rocksdb_optimistictransaction_options_create*(): ptr rocksdb_optimistictransaction_options_t {. - cdecl, importc: "rocksdb_optimistictransaction_options_create", - dynlib: librocksdb.} + cdecl, importc: "rocksdb_optimistictransaction_options_create", dynlib: librocksdb +.} + proc rocksdb_optimistictransaction_options_destroy*( - opt: ptr rocksdb_optimistictransaction_options_t) {.cdecl, - importc: "rocksdb_optimistictransaction_options_destroy", dynlib: librocksdb.} + opt: ptr rocksdb_optimistictransaction_options_t +) {. + cdecl, importc: "rocksdb_optimistictransaction_options_destroy", dynlib: librocksdb +.} + proc rocksdb_optimistictransaction_options_set_set_snapshot*( - opt: ptr rocksdb_optimistictransaction_options_t; v: uint8) {.cdecl, - importc: "rocksdb_optimistictransaction_options_set_set_snapshot", - dynlib: librocksdb.} + opt: ptr rocksdb_optimistictransaction_options_t, v: uint8 +) {. + cdecl, + importc: "rocksdb_optimistictransaction_options_set_set_snapshot", + dynlib: librocksdb +.} + proc rocksdb_optimistictransactiondb_property_value*( - db: ptr rocksdb_optimistictransactiondb_t; propname: cstring): cstring {.cdecl, - importc: "rocksdb_optimistictransactiondb_property_value", dynlib: librocksdb.} + db: ptr rocksdb_optimistictransactiondb_t, propname: cstring +): cstring {. + cdecl, importc: "rocksdb_optimistictransactiondb_property_value", dynlib: librocksdb +.} + proc rocksdb_optimistictransactiondb_property_int*( - db: ptr rocksdb_optimistictransactiondb_t; propname: cstring; out_val: ptr uint64): cint {. - cdecl, importc: "rocksdb_optimistictransactiondb_property_int", - dynlib: librocksdb.} + db: ptr rocksdb_optimistictransactiondb_t, propname: cstring, out_val: ptr uint64 +): cint {. + cdecl, importc: "rocksdb_optimistictransactiondb_property_int", dynlib: librocksdb +.} + ## referring to convention (3), this should be used by client ## to free memory that was malloc()ed -proc rocksdb_free*(`ptr`: pointer) {.cdecl, importc: "rocksdb_free", - dynlib: librocksdb.} -proc rocksdb_get_pinned*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - key: cstring; keylen: csize_t; errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_get_pinned", dynlib: librocksdb.} -proc rocksdb_get_pinned_cf*(db: ptr rocksdb_t; options: ptr rocksdb_readoptions_t; - column_family: ptr rocksdb_column_family_handle_t; - key: cstring; keylen: csize_t; errptr: cstringArray): ptr rocksdb_pinnableslice_t {. - cdecl, importc: "rocksdb_get_pinned_cf", dynlib: librocksdb.} -proc rocksdb_pinnableslice_destroy*(v: ptr rocksdb_pinnableslice_t) {.cdecl, - importc: "rocksdb_pinnableslice_destroy", dynlib: librocksdb.} -proc rocksdb_pinnableslice_value*(t: ptr rocksdb_pinnableslice_t; vlen: ptr csize_t): cstring {. - cdecl, importc: "rocksdb_pinnableslice_value", dynlib: librocksdb.} -proc rocksdb_memory_consumers_create*(): ptr rocksdb_memory_consumers_t {.cdecl, - importc: "rocksdb_memory_consumers_create", dynlib: librocksdb.} -proc rocksdb_memory_consumers_add_db*(consumers: ptr rocksdb_memory_consumers_t; - db: ptr rocksdb_t) {.cdecl, - importc: "rocksdb_memory_consumers_add_db", dynlib: librocksdb.} -proc rocksdb_memory_consumers_add_cache*(consumers: ptr rocksdb_memory_consumers_t; - cache: ptr rocksdb_cache_t) {.cdecl, - importc: "rocksdb_memory_consumers_add_cache", dynlib: librocksdb.} -proc rocksdb_memory_consumers_destroy*(consumers: ptr rocksdb_memory_consumers_t) {. - cdecl, importc: "rocksdb_memory_consumers_destroy", dynlib: librocksdb.} +proc rocksdb_free*( + `ptr`: pointer +) {.cdecl, importc: "rocksdb_free", dynlib: librocksdb.} + +proc rocksdb_get_pinned*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_get_pinned", dynlib: librocksdb +.} + +proc rocksdb_get_pinned_cf*( + db: ptr rocksdb_t, + options: ptr rocksdb_readoptions_t, + column_family: ptr rocksdb_column_family_handle_t, + key: cstring, + keylen: csize_t, + errptr: cstringArray, +): ptr rocksdb_pinnableslice_t {. + cdecl, importc: "rocksdb_get_pinned_cf", dynlib: librocksdb +.} + +proc rocksdb_pinnableslice_destroy*( + v: ptr rocksdb_pinnableslice_t +) {.cdecl, importc: "rocksdb_pinnableslice_destroy", dynlib: librocksdb.} + +proc rocksdb_pinnableslice_value*( + t: ptr rocksdb_pinnableslice_t, vlen: ptr csize_t +): cstring {.cdecl, importc: "rocksdb_pinnableslice_value", dynlib: librocksdb.} + +proc rocksdb_memory_consumers_create*(): ptr rocksdb_memory_consumers_t {. + cdecl, importc: "rocksdb_memory_consumers_create", dynlib: librocksdb +.} + +proc rocksdb_memory_consumers_add_db*( + consumers: ptr rocksdb_memory_consumers_t, db: ptr rocksdb_t +) {.cdecl, importc: "rocksdb_memory_consumers_add_db", dynlib: librocksdb.} + +proc rocksdb_memory_consumers_add_cache*( + consumers: ptr rocksdb_memory_consumers_t, cache: ptr rocksdb_cache_t +) {.cdecl, importc: "rocksdb_memory_consumers_add_cache", dynlib: librocksdb.} + +proc rocksdb_memory_consumers_destroy*( + consumers: ptr rocksdb_memory_consumers_t +) {.cdecl, importc: "rocksdb_memory_consumers_destroy", dynlib: librocksdb.} + proc rocksdb_approximate_memory_usage_create*( - consumers: ptr rocksdb_memory_consumers_t; errptr: cstringArray): ptr rocksdb_memory_usage_t {. - cdecl, importc: "rocksdb_approximate_memory_usage_create", dynlib: librocksdb.} -proc rocksdb_approximate_memory_usage_destroy*(usage: ptr rocksdb_memory_usage_t) {. - cdecl, importc: "rocksdb_approximate_memory_usage_destroy", dynlib: librocksdb.} + consumers: ptr rocksdb_memory_consumers_t, errptr: cstringArray +): ptr rocksdb_memory_usage_t {. + cdecl, importc: "rocksdb_approximate_memory_usage_create", dynlib: librocksdb +.} + +proc rocksdb_approximate_memory_usage_destroy*( + usage: ptr rocksdb_memory_usage_t +) {.cdecl, importc: "rocksdb_approximate_memory_usage_destroy", dynlib: librocksdb.} + proc rocksdb_approximate_memory_usage_get_mem_table_total*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl, - importc: "rocksdb_approximate_memory_usage_get_mem_table_total", - dynlib: librocksdb.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {. + cdecl, + importc: "rocksdb_approximate_memory_usage_get_mem_table_total", + dynlib: librocksdb +.} + proc rocksdb_approximate_memory_usage_get_mem_table_unflushed*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl, - importc: "rocksdb_approximate_memory_usage_get_mem_table_unflushed", - dynlib: librocksdb.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {. + cdecl, + importc: "rocksdb_approximate_memory_usage_get_mem_table_unflushed", + dynlib: librocksdb +.} + proc rocksdb_approximate_memory_usage_get_mem_table_readers_total*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl, - importc: "rocksdb_approximate_memory_usage_get_mem_table_readers_total", - dynlib: librocksdb.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {. + cdecl, + importc: "rocksdb_approximate_memory_usage_get_mem_table_readers_total", + dynlib: librocksdb +.} + proc rocksdb_approximate_memory_usage_get_cache_total*( - memory_usage: ptr rocksdb_memory_usage_t): uint64 {.cdecl, - importc: "rocksdb_approximate_memory_usage_get_cache_total", - dynlib: librocksdb.} -proc rocksdb_options_set_dump_malloc_stats*(a1: ptr rocksdb_options_t; a2: uint8) {. - cdecl, importc: "rocksdb_options_set_dump_malloc_stats", dynlib: librocksdb.} -proc rocksdb_options_set_memtable_whole_key_filtering*(a1: ptr rocksdb_options_t; - a2: uint8) {.cdecl, - importc: "rocksdb_options_set_memtable_whole_key_filtering", - dynlib: librocksdb.} -proc rocksdb_cancel_all_background_work*(db: ptr rocksdb_t; wait: uint8) {.cdecl, - importc: "rocksdb_cancel_all_background_work", dynlib: librocksdb.} -proc rocksdb_disable_manual_compaction*(db: ptr rocksdb_t) {.cdecl, - importc: "rocksdb_disable_manual_compaction", dynlib: librocksdb.} -proc rocksdb_enable_manual_compaction*(db: ptr rocksdb_t) {.cdecl, - importc: "rocksdb_enable_manual_compaction", dynlib: librocksdb.} + memory_usage: ptr rocksdb_memory_usage_t +): uint64 {. + cdecl, importc: "rocksdb_approximate_memory_usage_get_cache_total", dynlib: librocksdb +.} + +proc rocksdb_options_set_dump_malloc_stats*( + a1: ptr rocksdb_options_t, a2: uint8 +) {.cdecl, importc: "rocksdb_options_set_dump_malloc_stats", dynlib: librocksdb.} + +proc rocksdb_options_set_memtable_whole_key_filtering*( + a1: ptr rocksdb_options_t, a2: uint8 +) {. + cdecl, importc: "rocksdb_options_set_memtable_whole_key_filtering", dynlib: librocksdb +.} + +proc rocksdb_cancel_all_background_work*( + db: ptr rocksdb_t, wait: uint8 +) {.cdecl, importc: "rocksdb_cancel_all_background_work", dynlib: librocksdb.} + +proc rocksdb_disable_manual_compaction*( + db: ptr rocksdb_t +) {.cdecl, importc: "rocksdb_disable_manual_compaction", dynlib: librocksdb.} + +proc rocksdb_enable_manual_compaction*( + db: ptr rocksdb_t +) {.cdecl, importc: "rocksdb_enable_manual_compaction", dynlib: librocksdb.} + proc rocksdb_statistics_histogram_data_create*(): ptr rocksdb_statistics_histogram_data_t {. - cdecl, importc: "rocksdb_statistics_histogram_data_create", dynlib: librocksdb.} + cdecl, importc: "rocksdb_statistics_histogram_data_create", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_destroy*( - data: ptr rocksdb_statistics_histogram_data_t) {.cdecl, - importc: "rocksdb_statistics_histogram_data_destroy", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +) {.cdecl, importc: "rocksdb_statistics_histogram_data_destroy", dynlib: librocksdb.} + proc rocksdb_statistics_histogram_data_get_median*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_median", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_median", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_p95*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_p95", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_p95", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_p99*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_p99", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_p99", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_average*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_average", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_average", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_std_dev*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_std_dev", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_std_dev", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_max*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_max", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_max", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_count*( - data: ptr rocksdb_statistics_histogram_data_t): uint64 {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_count", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): uint64 {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_count", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_sum*( - data: ptr rocksdb_statistics_histogram_data_t): uint64 {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_sum", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): uint64 {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_sum", dynlib: librocksdb +.} + proc rocksdb_statistics_histogram_data_get_min*( - data: ptr rocksdb_statistics_histogram_data_t): cdouble {.cdecl, - importc: "rocksdb_statistics_histogram_data_get_min", dynlib: librocksdb.} -proc rocksdb_wait_for_compact*(db: ptr rocksdb_t; - options: ptr rocksdb_wait_for_compact_options_t; - errptr: cstringArray) {.cdecl, - importc: "rocksdb_wait_for_compact", dynlib: librocksdb.} + data: ptr rocksdb_statistics_histogram_data_t +): cdouble {. + cdecl, importc: "rocksdb_statistics_histogram_data_get_min", dynlib: librocksdb +.} + +proc rocksdb_wait_for_compact*( + db: ptr rocksdb_t, + options: ptr rocksdb_wait_for_compact_options_t, + errptr: cstringArray, +) {.cdecl, importc: "rocksdb_wait_for_compact", dynlib: librocksdb.} + proc rocksdb_wait_for_compact_options_create*(): ptr rocksdb_wait_for_compact_options_t {. - cdecl, importc: "rocksdb_wait_for_compact_options_create", dynlib: librocksdb.} + cdecl, importc: "rocksdb_wait_for_compact_options_create", dynlib: librocksdb +.} + proc rocksdb_wait_for_compact_options_destroy*( - opt: ptr rocksdb_wait_for_compact_options_t) {.cdecl, - importc: "rocksdb_wait_for_compact_options_destroy", dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t +) {.cdecl, importc: "rocksdb_wait_for_compact_options_destroy", dynlib: librocksdb.} + proc rocksdb_wait_for_compact_options_set_abort_on_pause*( - opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl, - importc: "rocksdb_wait_for_compact_options_set_abort_on_pause", - dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 +) {. + cdecl, + importc: "rocksdb_wait_for_compact_options_set_abort_on_pause", + dynlib: librocksdb +.} + proc rocksdb_wait_for_compact_options_get_abort_on_pause*( - opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl, - importc: "rocksdb_wait_for_compact_options_get_abort_on_pause", - dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t +): uint8 {. + cdecl, + importc: "rocksdb_wait_for_compact_options_get_abort_on_pause", + dynlib: librocksdb +.} + proc rocksdb_wait_for_compact_options_set_flush*( - opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl, - importc: "rocksdb_wait_for_compact_options_set_flush", dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 +) {.cdecl, importc: "rocksdb_wait_for_compact_options_set_flush", dynlib: librocksdb.} + proc rocksdb_wait_for_compact_options_get_flush*( - opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl, - importc: "rocksdb_wait_for_compact_options_get_flush", dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t +): uint8 {. + cdecl, importc: "rocksdb_wait_for_compact_options_get_flush", dynlib: librocksdb +.} + proc rocksdb_wait_for_compact_options_set_close_db*( - opt: ptr rocksdb_wait_for_compact_options_t; v: uint8) {.cdecl, - importc: "rocksdb_wait_for_compact_options_set_close_db", dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t, v: uint8 +) {. + cdecl, importc: "rocksdb_wait_for_compact_options_set_close_db", dynlib: librocksdb +.} + proc rocksdb_wait_for_compact_options_get_close_db*( - opt: ptr rocksdb_wait_for_compact_options_t): uint8 {.cdecl, - importc: "rocksdb_wait_for_compact_options_get_close_db", dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t +): uint8 {. + cdecl, importc: "rocksdb_wait_for_compact_options_get_close_db", dynlib: librocksdb +.} + proc rocksdb_wait_for_compact_options_set_timeout*( - opt: ptr rocksdb_wait_for_compact_options_t; microseconds: uint64) {.cdecl, - importc: "rocksdb_wait_for_compact_options_set_timeout", dynlib: librocksdb.} + opt: ptr rocksdb_wait_for_compact_options_t, microseconds: uint64 +) {.cdecl, importc: "rocksdb_wait_for_compact_options_set_timeout", dynlib: librocksdb.} + proc rocksdb_wait_for_compact_options_get_timeout*( - opt: ptr rocksdb_wait_for_compact_options_t): uint64 {.cdecl, - importc: "rocksdb_wait_for_compact_options_get_timeout", dynlib: librocksdb.} \ No newline at end of file + opt: ptr rocksdb_wait_for_compact_options_t +): uint64 {. + cdecl, importc: "rocksdb_wait_for_compact_options_get_timeout", dynlib: librocksdb +.} diff --git a/rocksdb/options/backupopts.nim b/rocksdb/options/backupopts.nim index ea22c38..769a2ac 100644 --- a/rocksdb/options/backupopts.nim +++ b/rocksdb/options/backupopts.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb +import ../lib/librocksdb type BackupEngineOptionsPtr* = ptr rocksdb_options_t @@ -34,7 +33,6 @@ proc defaultBackupEngineOptions*(): BackupEngineOptionsRef {.inline.} = let opts = newBackupEngineOptions() opts - proc close*(engineOpts: BackupEngineOptionsRef) = if not engineOpts.isClosed(): rocksdb_options_destroy(engineOpts.cPtr) diff --git a/rocksdb/options/cache.nim b/rocksdb/options/cache.nim index 93d7e57..9d53b3a 100644 --- a/rocksdb/options/cache.nim +++ b/rocksdb/options/cache.nim @@ -1,5 +1,4 @@ -import - ../lib/librocksdb +import ../lib/librocksdb type CachePtr* = ptr rocksdb_cache_t diff --git a/rocksdb/options/dbopts.nim b/rocksdb/options/dbopts.nim index c6ceb36..28ba3bb 100644 --- a/rocksdb/options/dbopts.nim +++ b/rocksdb/options/dbopts.nim @@ -9,10 +9,7 @@ {.push raises: [].} -import - std/cpuinfo, - ../lib/librocksdb, - ./[cache, tableopts] +import std/cpuinfo, ../lib/librocksdb, ./[cache, tableopts] export cache, tableopts diff --git a/rocksdb/options/readopts.nim b/rocksdb/options/readopts.nim index 321b954..0e719c8 100644 --- a/rocksdb/options/readopts.nim +++ b/rocksdb/options/readopts.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb +import ../lib/librocksdb type ReadOptionsPtr* = ptr rocksdb_readoptions_t diff --git a/rocksdb/options/tableopts.nim b/rocksdb/options/tableopts.nim index b7669d2..e8bdba8 100644 --- a/rocksdb/options/tableopts.nim +++ b/rocksdb/options/tableopts.nim @@ -1,6 +1,4 @@ -import - ../lib/librocksdb, - ./cache +import ../lib/librocksdb, ./cache type # TODO might eventually wrap this @@ -21,13 +19,18 @@ type DataBlockIndexType* {.pure.} = enum binarySearch = rocksdb_block_based_table_data_block_index_type_binary_search - binarySearchAndHash = rocksdb_block_based_table_data_block_index_type_binary_search_and_hash + binarySearchAndHash = + rocksdb_block_based_table_data_block_index_type_binary_search_and_hash proc createRibbon*(bitsPerKey: float): FilterPolicyRef = FilterPolicyRef(cPtr: rocksdb_filterpolicy_create_ribbon(bitsPerKey)) -proc createRibbonHybrid*(bitsPerKey: float, bloomBeforeLevel: int = 0): FilterPolicyRef = - FilterPolicyRef(cPtr: rocksdb_filterpolicy_create_ribbon_hybrid(bitsPerKey, bloomBeforeLevel.cint)) +proc createRibbonHybrid*( + bitsPerKey: float, bloomBeforeLevel: int = 0 +): FilterPolicyRef = + FilterPolicyRef( + cPtr: rocksdb_filterpolicy_create_ribbon_hybrid(bitsPerKey, bloomBeforeLevel.cint) + ) proc isClosed*(policy: FilterPolicyRef): bool = isNil(policy.cPtr) @@ -81,7 +84,7 @@ proc `filterPolicy=`*(opts: TableOptionsRef, policy: FilterPolicyRef) = proc defaultTableOptions*(): TableOptionsRef = # https://github.com/facebook/rocksdb/wiki/Setup-Options-and-Basic-Tuning#other-general-options let opts = createTableOptions() - opts.blockSize = 16*1024 + opts.blockSize = 16 * 1024 opts.cacheIndexAndFilterBlocks = true opts.pinL0FilterAndIndexBlocksInCache = true opts diff --git a/rocksdb/options/writeopts.nim b/rocksdb/options/writeopts.nim index fd2a027..9648f06 100644 --- a/rocksdb/options/writeopts.nim +++ b/rocksdb/options/writeopts.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb +import ../lib/librocksdb type WriteOptionsPtr* = ptr rocksdb_writeoptions_t diff --git a/rocksdb/rocksdb.nim b/rocksdb/rocksdb.nim index 949de77..afc933b 100644 --- a/rocksdb/rocksdb.nim +++ b/rocksdb/rocksdb.nim @@ -35,14 +35,7 @@ import ./rocksresult, ./writebatch -export - rocksresult, - dbopts, - readopts, - writeopts, - cfdescriptor, - rocksiterator, - writebatch +export rocksresult, dbopts, readopts, writeopts, cfdescriptor, rocksiterator, writebatch type RocksDbPtr* = ptr rocksdb_t @@ -64,9 +57,8 @@ type ingestOptsPtr: IngestExternalFilesOptionsPtr proc listColumnFamilies*( - path: string; - dbOpts = DbOptionsRef(nil); - ): RocksDBResult[seq[string]] = + path: string, dbOpts = DbOptionsRef(nil) +): RocksDBResult[seq[string]] = ## List exisiting column families on disk. This might be used to find out ## whether there were some columns missing with the version on disk. ## @@ -78,30 +70,28 @@ proc listColumnFamilies*( ## above once rocksdb has been upgraded to the latest version, see comments ## at the end of ./columnfamily/cfhandle.nim. ## - let - useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) + let useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) defer: - if dbOpts.isNil: useDbOpts.close() + if dbOpts.isNil: + useDbOpts.close() var lencf: csize_t errors: cstring - let - cList = rocksdb_list_column_families( - useDbOpts.cPtr, - path.cstring, - addr lencf, - cast[cstringArray](errors.addr)) + let cList = rocksdb_list_column_families( + useDbOpts.cPtr, path.cstring, addr lencf, cast[cstringArray](errors.addr) + ) bailOnErrors(errors) var cfs: seq[string] if not cList.isNil: - defer: rocksdb_free(cList) + defer: + rocksdb_free(cList) for n in 0 ..< lencf: if cList[n].isNil: # Clean up the rest - for z in n+1 ..< lencf: + for z in n + 1 ..< lencf: if not cList[z].isNil: rocksdb_free(cList[z]) return err("short reply") @@ -112,22 +102,22 @@ proc listColumnFamilies*( ok cfs proc openRocksDb*( - path: string; - dbOpts = DbOptionsRef(nil); - readOpts = ReadOptionsRef(nil); - writeOpts = WriteOptionsRef(nil); - columnFamilies: openArray[ColFamilyDescriptor] = []; - ): RocksDBResult[RocksDbReadWriteRef] = + path: string, + dbOpts = DbOptionsRef(nil), + readOpts = ReadOptionsRef(nil), + writeOpts = WriteOptionsRef(nil), + columnFamilies: openArray[ColFamilyDescriptor] = [], +): RocksDBResult[RocksDbReadWriteRef] = ## Open a RocksDB instance in read-write mode. If `columnFamilies` is empty ## then it will open the default column family. If `dbOpts`, `readOpts`, or ## `writeOpts` are not supplied then the default options will be used. ## By default, column families will be created if they don't yet exist. ## All existing column families must be specified if the database has ## previously created any column families. - let - useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) + let useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) defer: - if dbOpts.isNil: useDbOpts.close() + if dbOpts.isNil: + useDbOpts.close() var cfs = columnFamilies.toSeq() if DEFAULT_COLUMN_FAMILY_NAME notin columnFamilies.mapIt(it.name()): @@ -139,13 +129,14 @@ proc openRocksDb*( cfHandles = newSeq[ColFamilyHandlePtr](cfs.len) errors: cstring let rocksDbPtr = rocksdb_open_column_families( - useDbOpts.cPtr, - path.cstring, - cfNames.len().cint, - cast[cstringArray](cfNames[0].addr), - cfOpts[0].addr, - cfHandles[0].addr, - cast[cstringArray](errors.addr)) + useDbOpts.cPtr, + path.cstring, + cfNames.len().cint, + cast[cstringArray](cfNames[0].addr), + cfOpts[0].addr, + cfHandles[0].addr, + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) let @@ -161,26 +152,27 @@ proc openRocksDb*( writeOpts: writeOpts, ingestOptsPtr: rocksdb_ingestexternalfileoptions_create(), defaultCfName: DEFAULT_COLUMN_FAMILY_NAME, - cfTable: newColFamilyTable(cfNames.mapIt($it), cfHandles)) + cfTable: newColFamilyTable(cfNames.mapIt($it), cfHandles), + ) ok(db) proc openRocksDbReadOnly*( - path: string; - dbOpts = DbOptionsRef(nil); - readOpts = ReadOptionsRef(nil); - columnFamilies: openArray[ColFamilyDescriptor] = []; - errorIfWalFileExists = false; - ): RocksDBResult[RocksDbReadOnlyRef] = + path: string, + dbOpts = DbOptionsRef(nil), + readOpts = ReadOptionsRef(nil), + columnFamilies: openArray[ColFamilyDescriptor] = [], + errorIfWalFileExists = false, +): RocksDBResult[RocksDbReadOnlyRef] = ## Open a RocksDB instance in read-only mode. If `columnFamilies` is empty ## then it will open the default column family. If `dbOpts` or `readOpts` are ## not supplied then the default options will be used. By default, column ## families will be created if they don't yet exist. If the database already ## contains any column families, then all or a subset of the existing column ## families can be opened for reading. - let - useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) + let useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) defer: - if dbOpts.isNil: useDbOpts.close() + if dbOpts.isNil: + useDbOpts.close() var cfs = columnFamilies.toSeq() if DEFAULT_COLUMN_FAMILY_NAME notin columnFamilies.mapIt(it.name()): @@ -192,14 +184,15 @@ proc openRocksDbReadOnly*( cfHandles = newSeq[ColFamilyHandlePtr](cfs.len) errors: cstring let rocksDbPtr = rocksdb_open_for_read_only_column_families( - useDbOpts.cPtr, - path.cstring, - cfNames.len().cint, - cast[cstringArray](cfNames[0].addr), - cfOpts[0].addr, - cfHandles[0].addr, - errorIfWalFileExists.uint8, - cast[cstringArray](errors.addr)) + useDbOpts.cPtr, + path.cstring, + cfNames.len().cint, + cast[cstringArray](cfNames[0].addr), + cfOpts[0].addr, + cfHandles[0].addr, + errorIfWalFileExists.uint8, + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) let @@ -212,7 +205,8 @@ proc openRocksDbReadOnly*( dbOpts: dbOpts, readOpts: readOpts, defaultCfName: DEFAULT_COLUMN_FAMILY_NAME, - cfTable: newColFamilyTable(cfNames.mapIt($it), cfHandles)) + cfTable: newColFamilyTable(cfNames.mapIt($it), cfHandles), + ) ok(db) proc isClosed*(db: RocksDbRef): bool {.inline.} = @@ -228,7 +222,8 @@ proc get*( db: RocksDbRef, key: openArray[byte], onData: DataProc, - columnFamily = db.defaultCfName): RocksDBResult[bool] = + columnFamily = db.defaultCfName, +): RocksDBResult[bool] = ## Get the value for the given key from the specified column family. ## If the value does not exist, `false` will be returned in the result ## and `onData` will not be called. If the value does exist, `true` will be @@ -247,13 +242,14 @@ proc get*( len: csize_t errors: cstring let data = rocksdb_get_cf( - db.cPtr, - db.readOpts.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - len.addr, - cast[cstringArray](errors.addr)) + db.cPtr, + db.readOpts.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + len.addr, + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) if data.isNil(): @@ -265,15 +261,15 @@ proc get*( ok(true) proc get*( - db: RocksDbRef, - key: openArray[byte], - columnFamily = db.defaultCfName): RocksDBResult[seq[byte]] = + db: RocksDbRef, key: openArray[byte], columnFamily = db.defaultCfName +): RocksDBResult[seq[byte]] = ## Get the value for the given key from the specified column family. ## If the value does not exist, an empty error will be returned in the result. ## If the value does exist, the value will be returned in the result. var dataRes: RocksDBResult[seq[byte]] - proc onData(data: openArray[byte]) = dataRes.ok(@data) + proc onData(data: openArray[byte]) = + dataRes.ok(@data) let res = db.get(key, onData, columnFamily) if res.isOk(): @@ -282,9 +278,8 @@ proc get*( dataRes.err(res.error()) proc put*( - db: RocksDbReadWriteRef, - key, val: openArray[byte], - columnFamily = db.defaultCfName): RocksDBResult[void] = + db: RocksDbReadWriteRef, key, val: openArray[byte], columnFamily = db.defaultCfName +): RocksDBResult[void] = ## Put the value for the given key into the specified column family. if key.len() == 0: @@ -296,22 +291,26 @@ proc put*( var errors: cstring rocksdb_put_cf( - db.cPtr, - db.writeOpts.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - cast[cstring](if val.len > 0: unsafeAddr val[0] else: nil), - csize_t(val.len), - cast[cstringArray](errors.addr)) + db.cPtr, + db.writeOpts.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstring](if val.len > 0: + unsafeAddr val[0] + else: + nil + ), + csize_t(val.len), + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() proc keyExists*( - db: RocksDbRef, - key: openArray[byte], - columnFamily = db.defaultCfName): RocksDBResult[bool] = + db: RocksDbRef, key: openArray[byte], columnFamily = db.defaultCfName +): RocksDBResult[bool] = ## Check if the key exists in the specified column family. ## Returns a result containing `true` if the key exists or a result ## containing `false` otherwise. @@ -319,12 +318,17 @@ proc keyExists*( # TODO: Call rocksdb_key_may_exist_cf to improve performance for the case # when the key does not exist - db.get(key, proc(data: openArray[byte]) = discard, columnFamily) + db.get( + key, + proc(data: openArray[byte]) = + discard + , + columnFamily, + ) proc delete*( - db: RocksDbReadWriteRef, - key: openArray[byte], - columnFamily = db.defaultCfName): RocksDBResult[void] = + db: RocksDbReadWriteRef, key: openArray[byte], columnFamily = db.defaultCfName +): RocksDBResult[void] = ## Delete the value for the given key from the specified column family. ## If the value does not exist, the delete will be a no-op. ## To check if the value exists before or after a delete, use `keyExists`. @@ -338,67 +342,61 @@ proc delete*( var errors: cstring rocksdb_delete_cf( - db.cPtr, - db.writeOpts.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - cast[cstringArray](errors.addr)) + db.cPtr, + db.writeOpts.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() proc openIterator*( - db: RocksDbRef, - columnFamily = db.defaultCfName): RocksDBResult[RocksIteratorRef] = + db: RocksDbRef, columnFamily = db.defaultCfName +): RocksDBResult[RocksIteratorRef] = ## Opens an `RocksIteratorRef` for the specified column family. doAssert not db.isClosed() - let cfHandle = db.cfTable.get(columnFamily) + let cfHandle = db.cfTable.get(columnFamily) if cfHandle.isNil(): return err("rocksdb: unknown column family") - let rocksIterPtr = rocksdb_create_iterator_cf( - db.cPtr, - db.readOpts.cPtr, - cfHandle.cPtr) + let rocksIterPtr = + rocksdb_create_iterator_cf(db.cPtr, db.readOpts.cPtr, cfHandle.cPtr) ok(newRocksIterator(rocksIterPtr)) proc openWriteBatch*( - db: RocksDbReadWriteRef, - columnFamily = db.defaultCfName): WriteBatchRef = + db: RocksDbReadWriteRef, columnFamily = db.defaultCfName +): WriteBatchRef = ## Opens a `WriteBatchRef` which defaults to using the specified column family. doAssert not db.isClosed() newWriteBatch(db.cfTable, columnFamily) -proc write*( - db: RocksDbReadWriteRef, - updates: WriteBatchRef): RocksDBResult[void] = +proc write*(db: RocksDbReadWriteRef, updates: WriteBatchRef): RocksDBResult[void] = ## Apply the updates in the `WriteBatchRef` to the database. doAssert not db.isClosed() var errors: cstring rocksdb_write( - db.cPtr, - db.writeOpts.cPtr, - updates.cPtr, - cast[cstringArray](errors.addr)) + db.cPtr, db.writeOpts.cPtr, updates.cPtr, cast[cstringArray](errors.addr) + ) bailOnErrors(errors) ok() proc ingestExternalFile*( - db: RocksDbReadWriteRef, - filePath: string, - columnFamily = db.defaultCfName): RocksDBResult[void] = + db: RocksDbReadWriteRef, filePath: string, columnFamily = db.defaultCfName +): RocksDBResult[void] = ## Ingest an external sst file into the database. The file will be ingested ## into the specified column family or the default column family if none is ## provided. doAssert not db.isClosed() - let cfHandle = db.cfTable.get(columnFamily) + let cfHandle = db.cfTable.get(columnFamily) if cfHandle.isNil(): return err("rocksdb: unknown column family") @@ -408,9 +406,11 @@ proc ingestExternalFile*( rocksdb_ingest_external_file_cf( db.cPtr, cfHandle.cPtr, - cast[cstringArray](sstPath.addr), csize_t(1), + cast[cstringArray](sstPath.addr), + csize_t(1), db.ingestOptsPtr, - cast[cstringArray](errors.addr)) + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() diff --git a/rocksdb/rocksiterator.nim b/rocksdb/rocksiterator.nim index 2e608e6..c421981 100644 --- a/rocksdb/rocksiterator.nim +++ b/rocksdb/rocksiterator.nim @@ -12,13 +12,9 @@ {.push raises: [].} -import - ./lib/librocksdb, - ./internal/utils, - ./rocksresult +import ./lib/librocksdb, ./internal/utils, ./rocksresult -export - rocksresult +export rocksresult type RocksIteratorPtr* = ptr rocksdb_iterator_t @@ -138,15 +134,22 @@ iterator pairs*(iter: RocksIteratorRef): tuple[key: seq[byte], value: seq[byte]] ## the form of a tuple. The iterator is automatically closed after the ## iteration. doAssert not iter.isClosed() - defer: iter.close() + defer: + iter.close() iter.seekToFirst() while iter.isValid(): var key: seq[byte] value: seq[byte] - iter.key(proc(data: openArray[byte]) = key = @data) - iter.value(proc(data: openArray[byte]) = value = @data) + iter.key( + proc(data: openArray[byte]) = + key = @data + ) + iter.value( + proc(data: openArray[byte]) = + value = @data + ) iter.next() yield (key, value) diff --git a/rocksdb/rocksresult.nim b/rocksdb/rocksresult.nim index 290005d..1ad5643 100644 --- a/rocksdb/rocksresult.nim +++ b/rocksdb/rocksresult.nim @@ -9,11 +9,9 @@ {.push raises: [].} -import - results +import results -export - results +export results type RocksDBResult*[T] = Result[T, string] diff --git a/rocksdb/sstfilewriter.nim b/rocksdb/sstfilewriter.nim index 2a78631..63b4b9b 100644 --- a/rocksdb/sstfilewriter.nim +++ b/rocksdb/sstfilewriter.nim @@ -11,14 +11,9 @@ {.push raises: [].} -import - ./lib/librocksdb, - ./internal/utils, - ./options/dbopts, - ./rocksresult +import ./lib/librocksdb, ./internal/utils, ./options/dbopts, ./rocksresult -export - rocksresult +export rocksresult type SstFileWriterPtr* = ptr rocksdb_sstfilewriter_t @@ -30,9 +25,8 @@ type dbOpts: DbOptionsRef proc openSstFileWriter*( - filePath: string; - dbOpts = DbOptionsRef(nil); - ): RocksDBResult[SstFileWriterRef] = + filePath: string, dbOpts = DbOptionsRef(nil) +): RocksDBResult[SstFileWriterRef] = ## Creates a new `SstFileWriterRef` and opens the file at the given `filePath`. let dbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) doAssert not dbOpts.isClosed() @@ -41,13 +35,13 @@ proc openSstFileWriter*( let writer = SstFileWriterRef( cPtr: rocksdb_sstfilewriter_create(envOptsPtr, dbOpts.cPtr), envOptsPtr: envOptsPtr, - dbOpts: dbOpts) + dbOpts: dbOpts, + ) var errors: cstring rocksdb_sstfilewriter_open( - writer.cPtr, - filePath.cstring, - cast[cstringArray](errors.addr)) + writer.cPtr, filePath.cstring, cast[cstringArray](errors.addr) + ) bailOnErrors(errors) ok(writer) @@ -57,17 +51,19 @@ proc isClosed*(writer: SstFileWriterRef): bool {.inline.} = writer.cPtr.isNil() proc put*( - writer: SstFileWriterRef, - key: openArray[byte], - val: openArray[byte]): RocksDBResult[void] = + writer: SstFileWriterRef, key: openArray[byte], val: openArray[byte] +): RocksDBResult[void] = ## Add a key-value pair to the sst file. var errors: cstring rocksdb_sstfilewriter_put( - writer.cPtr, - cast[cstring](unsafeAddr key[0]), csize_t(key.len), - cast[cstring](unsafeAddr val[0]), csize_t(val.len), - cast[cstringArray](errors.addr)) + writer.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstring](unsafeAddr val[0]), + csize_t(val.len), + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() @@ -77,9 +73,11 @@ proc delete*(writer: SstFileWriterRef, key: openArray[byte]): RocksDBResult[void var errors: cstring rocksdb_sstfilewriter_delete( - writer.cPtr, - cast[cstring](unsafeAddr key[0]), csize_t(key.len), - cast[cstringArray](errors.addr)) + writer.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() diff --git a/rocksdb/transactiondb.nim b/rocksdb/transactiondb.nim index 9f072d2..79bfc2b 100644 --- a/rocksdb/transactiondb.nim +++ b/rocksdb/transactiondb.nim @@ -25,14 +25,7 @@ import ./rocksresult export - dbopts, - txdbopts, - cfdescriptor, - readopts, - writeopts, - txopts, - transaction, - rocksresult + dbopts, txdbopts, cfdescriptor, readopts, writeopts, txopts, transaction, rocksresult type TransactionDbPtr* = ptr rocksdb_transactiondb_t @@ -47,17 +40,17 @@ type proc openTransactionDb*( path: string, - dbOpts = DbOptionsRef(nil); - txDbOpts = TransactionDbOptionsRef(nil); - columnFamilies: openArray[ColFamilyDescriptor] = []; - ): RocksDBResult[TransactionDbRef] = + dbOpts = DbOptionsRef(nil), + txDbOpts = TransactionDbOptionsRef(nil), + columnFamilies: openArray[ColFamilyDescriptor] = [], +): RocksDBResult[TransactionDbRef] = ## Open a `TransactionDbRef` with the given options and column families. ## If no column families are provided the default column family will be used. ## If no options are provided the default options will be used. - let - useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) + let useDbOpts = (if dbOpts.isNil: defaultDbOptions() else: dbOpts) defer: - if dbOpts.isNil: useDbOpts.close() + if dbOpts.isNil: + useDbOpts.close() var cfs = columnFamilies.toSeq() if DEFAULT_COLUMN_FAMILY_NAME notin columnFamilies.mapIt(it.name()): @@ -70,26 +63,30 @@ proc openTransactionDb*( errors: cstring let txDbPtr = rocksdb_transactiondb_open_column_families( - useDbOpts.cPtr, - txDbOpts.cPtr, - path.cstring, - cfNames.len().cint, - cast[cstringArray](cfNames[0].addr), - cfOpts[0].addr, - cfHandles[0].addr, - cast[cstringArray](errors.addr)) + useDbOpts.cPtr, + txDbOpts.cPtr, + path.cstring, + cfNames.len().cint, + cast[cstringArray](cfNames[0].addr), + cfOpts[0].addr, + cfHandles[0].addr, + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) let dbOpts = useDbOpts # don't close on exit - txDbOpts = (if txDbOpts.isNil: defaultTransactionDbOptions() else: txDbOpts) + txDbOpts = (if txDbOpts.isNil: defaultTransactionDbOptions() + else: txDbOpts + ) db = TransactionDbRef( lock: createLock(), cPtr: txDbPtr, path: path, dbOpts: dbOpts, txDbOpts: txDbOpts, - cfTable: newColFamilyTable(cfNames.mapIt($it), cfHandles)) + cfTable: newColFamilyTable(cfNames.mapIt($it), cfHandles), + ) ok(db) proc isClosed*(db: TransactionDbRef): bool {.inline.} = @@ -97,27 +94,25 @@ proc isClosed*(db: TransactionDbRef): bool {.inline.} = db.cPtr.isNil() proc beginTransaction*( - db: TransactionDbRef; - readOpts = ReadOptionsRef(nil); - writeOpts = WriteOptionsRef(nil); - txDbOpts = TransactionDbOptionsRef(nil); - txOpts = defaultTransactionOptions(); - columnFamily = DEFAULT_COLUMN_FAMILY_NAME; - ): TransactionRef = + db: TransactionDbRef, + readOpts = ReadOptionsRef(nil), + writeOpts = WriteOptionsRef(nil), + txDbOpts = TransactionDbOptionsRef(nil), + txOpts = defaultTransactionOptions(), + columnFamily = DEFAULT_COLUMN_FAMILY_NAME, +): TransactionRef = ## Begin a new transaction against the database. The transaction will default ## to using the specified column family. If no column family is specified ## then the default column family will be used. doAssert not db.isClosed() let - txDbOpts = (if txDbOpts.isNil: defaultTransactionDbOptions() else: txDbOpts) + txDbOpts = (if txDbOpts.isNil: defaultTransactionDbOptions() + else: txDbOpts + ) readOpts = (if readOpts.isNil: defaultReadOptions() else: readOpts) writeOpts = (if writeOpts.isNil: defaultWriteOptions() else: writeOpts) - let txPtr = rocksdb_transaction_begin( - db.cPtr, - writeOpts.cPtr, - txOpts.cPtr, - nil) + let txPtr = rocksdb_transaction_begin(db.cPtr, writeOpts.cPtr, txOpts.cPtr, nil) newTransaction(txPtr, readOpts, writeOpts, txOpts, columnFamily, db.cfTable) diff --git a/rocksdb/transactions/transaction.nim b/rocksdb/transactions/transaction.nim index 36b9246..b877736 100644 --- a/rocksdb/transactions/transaction.nim +++ b/rocksdb/transactions/transaction.nim @@ -26,8 +26,7 @@ import ../rocksresult, ./txopts -export - rocksresult +export rocksresult type TransactionPtr* = ptr rocksdb_transaction_t @@ -46,15 +45,16 @@ proc newTransaction*( writeOpts: WriteOptionsRef, txOpts: TransactionOptionsRef, defaultCfName: string, - cfTable: ColFamilyTableRef): TransactionRef = - + cfTable: ColFamilyTableRef, +): TransactionRef = TransactionRef( - cPtr: cPtr, - readOpts: readOpts, - writeOpts: writeOpts, - txOpts: txOpts, - defaultCfName: defaultCfName, - cfTable: cfTable) + cPtr: cPtr, + readOpts: readOpts, + writeOpts: writeOpts, + txOpts: txOpts, + defaultCfName: defaultCfName, + cfTable: cfTable, + ) proc isClosed*(tx: TransactionRef): bool {.inline.} = ## Returns `true` if the `TransactionRef` has been closed. @@ -64,7 +64,8 @@ proc get*( tx: TransactionRef, key: openArray[byte], onData: DataProc, - columnFamily = tx.defaultCfName): RocksDBResult[bool] = + columnFamily = tx.defaultCfName, +): RocksDBResult[bool] = ## Get the value for a given key from the transaction using the provided ## `onData` callback. @@ -79,13 +80,14 @@ proc get*( len: csize_t errors: cstring let data = rocksdb_transaction_get_cf( - tx.cPtr, - tx.readOpts.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - len.addr, - cast[cstringArray](errors.addr)) + tx.cPtr, + tx.readOpts.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + len.addr, + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) if data.isNil(): @@ -97,9 +99,8 @@ proc get*( ok(true) proc get*( - tx: TransactionRef, - key: openArray[byte], - columnFamily = tx.defaultCfName): RocksDBResult[seq[byte]] = + tx: TransactionRef, key: openArray[byte], columnFamily = tx.defaultCfName +): RocksDBResult[seq[byte]] = ## Get the value for a given key from the transaction. var dataRes: RocksDBResult[seq[byte]] @@ -113,9 +114,8 @@ proc get*( dataRes.err(res.error()) proc put*( - tx: TransactionRef, - key, val: openArray[byte], - columnFamily = tx.defaultCfName): RocksDBResult[void] = + tx: TransactionRef, key, val: openArray[byte], columnFamily = tx.defaultCfName +): RocksDBResult[void] = ## Put the value for the given key into the transaction. if key.len() == 0: @@ -127,21 +127,25 @@ proc put*( var errors: cstring rocksdb_transaction_put_cf( - tx.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - cast[cstring](if val.len > 0: unsafeAddr val[0] else: nil), - csize_t(val.len), - cast[cstringArray](errors.addr)) + tx.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstring](if val.len > 0: + unsafeAddr val[0] + else: + nil + ), + csize_t(val.len), + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() proc delete*( - tx: TransactionRef, - key: openArray[byte], - columnFamily = tx.defaultCfName): RocksDBResult[void] = + tx: TransactionRef, key: openArray[byte], columnFamily = tx.defaultCfName +): RocksDBResult[void] = ## Delete the value for the given key from the transaction. if key.len() == 0: @@ -153,11 +157,12 @@ proc delete*( var errors: cstring rocksdb_transaction_delete_cf( - tx.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - cast[cstringArray](errors.addr)) + tx.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstringArray](errors.addr), + ) bailOnErrors(errors) ok() diff --git a/rocksdb/transactions/txdbopts.nim b/rocksdb/transactions/txdbopts.nim index 45911c2..6cb0fea 100644 --- a/rocksdb/transactions/txdbopts.nim +++ b/rocksdb/transactions/txdbopts.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb +import ../lib/librocksdb type TransactionDbOptionsPtr* = ptr rocksdb_transactiondb_options_t diff --git a/rocksdb/transactions/txopts.nim b/rocksdb/transactions/txopts.nim index 4ac58d7..395be16 100644 --- a/rocksdb/transactions/txopts.nim +++ b/rocksdb/transactions/txopts.nim @@ -9,8 +9,7 @@ {.push raises: [].} -import - ../lib/librocksdb +import ../lib/librocksdb type TransactionOptionsPtr* = ptr rocksdb_transaction_options_t diff --git a/rocksdb/writebatch.nim b/rocksdb/writebatch.nim index 6eddefc..7770fad 100644 --- a/rocksdb/writebatch.nim +++ b/rocksdb/writebatch.nim @@ -11,13 +11,9 @@ {.push raises: [].} -import - ./lib/librocksdb, - ./internal/[cftable, utils], - ./rocksresult +import ./lib/librocksdb, ./internal/[cftable, utils], ./rocksresult -export - rocksresult +export rocksresult type WriteBatchPtr* = ptr rocksdb_writebatch_t @@ -29,9 +25,8 @@ type proc newWriteBatch*(cfTable: ColFamilyTableRef, defaultCfName: string): WriteBatchRef = WriteBatchRef( - cPtr: rocksdb_writebatch_create(), - defaultCfName: defaultCfName, - cfTable: cfTable) + cPtr: rocksdb_writebatch_create(), defaultCfName: defaultCfName, cfTable: cfTable + ) proc isClosed*(batch: WriteBatchRef): bool {.inline.} = ## Returns `true` if the `WriteBatchRef` has been closed and `false` otherwise. @@ -55,7 +50,8 @@ proc count*(batch: WriteBatchRef): int = proc put*( batch: WriteBatchRef, key, val: openArray[byte], - columnFamily = DEFAULT_COLUMN_FAMILY_NAME): RocksDBResult[void] = + columnFamily = DEFAULT_COLUMN_FAMILY_NAME, +): RocksDBResult[void] = ## Add a put operation to the write batch. if key.len() == 0: @@ -66,19 +62,25 @@ proc put*( return err("rocksdb: unknown column family") rocksdb_writebatch_put_cf( - batch.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len), - cast[cstring](if val.len > 0: unsafeAddr val[0] else: nil), - csize_t(val.len)) + batch.cPtr, + cfHandle.cPtr, + cast[cstring](unsafeAddr key[0]), + csize_t(key.len), + cast[cstring](if val.len > 0: + unsafeAddr val[0] + else: + nil + ), + csize_t(val.len), + ) ok() proc delete*( batch: WriteBatchRef, key: openArray[byte], - columnFamily = DEFAULT_COLUMN_FAMILY_NAME): RocksDBResult[void] = + columnFamily = DEFAULT_COLUMN_FAMILY_NAME, +): RocksDBResult[void] = ## Add a delete operation to the write batch. if key.len() == 0: @@ -89,10 +91,8 @@ proc delete*( return err("rocksdb: unknown column family") rocksdb_writebatch_delete_cf( - batch.cPtr, - cfHandle.cPtr, - cast[cstring](unsafeAddr key[0]), - csize_t(key.len)) + batch.cPtr, cfHandle.cPtr, cast[cstring](unsafeAddr key[0]), csize_t(key.len) + ) ok() diff --git a/tests/columnfamily/test_cfdescriptor.nim b/tests/columnfamily/test_cfdescriptor.nim index af1c0c1..7951656 100644 --- a/tests/columnfamily/test_cfdescriptor.nim +++ b/tests/columnfamily/test_cfdescriptor.nim @@ -9,13 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/internal/utils, - ../../rocksdb/columnfamily/cfdescriptor +import unittest2, ../../rocksdb/internal/utils, ../../rocksdb/columnfamily/cfdescriptor suite "ColFamilyDescriptor Tests": - const TEST_CF_NAME = "test" test "Test initColFamilyDescriptor": @@ -56,4 +52,3 @@ suite "ColFamilyDescriptor Tests": check descriptor.isClosed() descriptor.close() check descriptor.isClosed() - diff --git a/tests/columnfamily/test_cfhandle.nim b/tests/columnfamily/test_cfhandle.nim index 151addf..5f3be9c 100644 --- a/tests/columnfamily/test_cfhandle.nim +++ b/tests/columnfamily/test_cfhandle.nim @@ -17,7 +17,6 @@ import ../../rocksdb/columnfamily/cfhandle suite "ColFamilyHandleRef Tests": - const TEST_CF_NAME = "test" setup: @@ -26,20 +25,17 @@ suite "ColFamilyHandleRef Tests": dbOpts = rocksdb_options_create() cfOpts = rocksdb_options_create() - var - errors: cstring + var errors: cstring - rocksdb_options_set_create_if_missing(dbOpts, 1); + rocksdb_options_set_create_if_missing(dbOpts, 1) let db = rocksdb_open(dbOpts, dbPath.cstring, cast[cstringArray](errors.addr)) doAssert errors.isNil() doAssert not db.isNil() let cfHandlePtr = rocksdb_create_column_family( - db, - cfOpts, - TEST_CF_NAME.cstring, - cast[cstringArray](errors.addr)) + db, cfOpts, TEST_CF_NAME.cstring, cast[cstringArray](errors.addr) + ) doAssert errors.isNil() doAssert not cfHandlePtr.isNil() @@ -64,4 +60,3 @@ suite "ColFamilyHandleRef Tests": check cfHandle.isClosed() cfHandle.close() check cfHandle.isClosed() - diff --git a/tests/columnfamily/test_cfopts.nim b/tests/columnfamily/test_cfopts.nim index 15b6c64..28d25a3 100644 --- a/tests/columnfamily/test_cfopts.nim +++ b/tests/columnfamily/test_cfopts.nim @@ -9,9 +9,7 @@ {.used.} -import - unittest2, - ../../rocksdb/columnfamily/cfopts +import unittest2, ../../rocksdb/columnfamily/cfopts suite "ColFamilyOptionsRef Tests": test "Test close": @@ -21,4 +19,4 @@ suite "ColFamilyOptionsRef Tests": cfOpts.close() check cfOpts.isClosed() cfOpts.close() - check cfOpts.isClosed() \ No newline at end of file + check cfOpts.isClosed() diff --git a/tests/internal/test_cftable.nim b/tests/internal/test_cftable.nim index 1fbd5c5..cb48744 100644 --- a/tests/internal/test_cftable.nim +++ b/tests/internal/test_cftable.nim @@ -18,7 +18,6 @@ import ../../rocksdb/internal/cftable suite "ColFamilyTableRef Tests": - const TEST_CF_NAME = "test" setup: @@ -27,20 +26,17 @@ suite "ColFamilyTableRef Tests": dbOpts = rocksdb_options_create() cfOpts = rocksdb_options_create() - var - errors: cstring + var errors: cstring - rocksdb_options_set_create_if_missing(dbOpts, 1); + rocksdb_options_set_create_if_missing(dbOpts, 1) let db = rocksdb_open(dbOpts, dbPath.cstring, cast[cstringArray](errors.addr)) doAssert errors.isNil() doAssert not db.isNil() let cfHandlePtr = rocksdb_create_column_family( - db, - cfOpts, - TEST_CF_NAME.cstring, - cast[cstringArray](errors.addr)) + db, cfOpts, TEST_CF_NAME.cstring, cast[cstringArray](errors.addr) + ) doAssert errors.isNil() doAssert not cfHandlePtr.isNil() @@ -48,11 +44,9 @@ suite "ColFamilyTableRef Tests": rocksdb_close(db) removeDir($dbPath) - test "Test newColFamilyTable": - var cfTable = newColFamilyTable( - @[TEST_CF_NAME, TEST_CF_NAME], - @[cfHandlePtr, cfHandlePtr]) + var cfTable = + newColFamilyTable(@[TEST_CF_NAME, TEST_CF_NAME], @[cfHandlePtr, cfHandlePtr]) check cfTable.get(TEST_CF_NAME).cPtr() == cfHandlePtr check not cfTable.isClosed() diff --git a/tests/lib/test_librocksdb.nim b/tests/lib/test_librocksdb.nim index 249250c..6296920 100644 --- a/tests/lib/test_librocksdb.nim +++ b/tests/lib/test_librocksdb.nim @@ -9,11 +9,7 @@ {.used.} -import - std/[cpuinfo, os], - tempfile, - unittest2, - ../../rocksdb/lib/librocksdb +import std/[cpuinfo, os], tempfile, unittest2, ../../rocksdb/lib/librocksdb suite "librocksdb C wrapper Tests": setup: @@ -37,54 +33,70 @@ suite "librocksdb C wrapper Tests": # snappy support (for example Fedora 28, certain Ubuntu versions) # rocksdb_options_optimize_level_style_compaction(options, 0); # create the DB if it's not already present - rocksdb_options_set_create_if_missing(options, 1); + rocksdb_options_set_create_if_missing(options, 1) - # open DB - var err: cstringArray # memory leak: example code does not free error string! + var # open DB + err: cstringArray # memory leak: example code does not free error string! db = rocksdb_open(options, dbPath, err) - check: err.isNil + check: + err.isNil # open Backup Engine that we will use for backing up our database be = rocksdb_backup_engine_open(options, dbBackupPath, err) - check: err.isNil + check: + err.isNil # Put key-value var writeOptions = rocksdb_writeoptions_create() let key = "key" let put_value = "value" rocksdb_put( - db, writeOptions, key.cstring, csize_t(key.len), - put_value.cstring, csize_t(put_value.len), err) - check: err.isNil + db, + writeOptions, + key.cstring, + csize_t(key.len), + put_value.cstring, + csize_t(put_value.len), + err, + ) + check: + err.isNil # Get value var readOptions = rocksdb_readoptions_create() var len: csize_t - let raw_value = rocksdb_get( - db, readOptions, key.cstring, csize_t(key.len), addr len, err) # Important: rocksdb_get is not null-terminated - check: err.isNil + let raw_value = + rocksdb_get(db, readOptions, key.cstring, csize_t(key.len), addr len, err) + # Important: rocksdb_get is not null-terminated + check: + err.isNil # Copy it to a regular Nim string (copyMem workaround because non-null terminated) var get_value = newString(int(len)) copyMem(addr get_value[0], unsafeAddr raw_value[0], int(len) * sizeof(char)) - check: $get_value == $put_value + check: + $get_value == $put_value # create new backup in a directory specified by DBBackupPath rocksdb_backup_engine_create_new_backup(be, db, err) - check: err.isNil + check: + err.isNil rocksdb_close(db) # If something is wrong, you might want to restore data from last backup var restoreOptions = rocksdb_restore_options_create() - rocksdb_backup_engine_restore_db_from_latest_backup(be, dbPath, dbPath, - restoreOptions, err) - check: err.isNil + rocksdb_backup_engine_restore_db_from_latest_backup( + be, dbPath, dbPath, restoreOptions, err + ) + check: + err.isNil rocksdb_restore_options_destroy(restoreOptions) db = rocksdb_open(options, dbPath, err) - check: err.isNil + check: + err.isNil # cleanup rocksdb_writeoptions_destroy(writeOptions) diff --git a/tests/options/test_backupopts.nim b/tests/options/test_backupopts.nim index 8215b6a..3b10b50 100644 --- a/tests/options/test_backupopts.nim +++ b/tests/options/test_backupopts.nim @@ -9,12 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/options/backupopts +import unittest2, ../../rocksdb/options/backupopts suite "BackupEngineOptionsRef Tests": - test "Test newBackupEngineOptions": var backupOpts = newBackupEngineOptions() @@ -36,4 +33,4 @@ suite "BackupEngineOptionsRef Tests": backupOpts.close() check backupOpts.isClosed() backupOpts.close() - check backupOpts.isClosed() \ No newline at end of file + check backupOpts.isClosed() diff --git a/tests/options/test_dbopts.nim b/tests/options/test_dbopts.nim index 6c37386..b0f9513 100644 --- a/tests/options/test_dbopts.nim +++ b/tests/options/test_dbopts.nim @@ -9,12 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/options/dbopts +import unittest2, ../../rocksdb/options/dbopts suite "DbOptionsRef Tests": - test "Test newDbOptions": var dbOpts = newDbOptions() @@ -37,4 +34,4 @@ suite "DbOptionsRef Tests": dbOpts.close() check dbOpts.isClosed() dbOpts.close() - check dbOpts.isClosed() \ No newline at end of file + check dbOpts.isClosed() diff --git a/tests/options/test_readopts.nim b/tests/options/test_readopts.nim index 9d72b36..2651f3f 100644 --- a/tests/options/test_readopts.nim +++ b/tests/options/test_readopts.nim @@ -9,12 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/options/readopts +import unittest2, ../../rocksdb/options/readopts suite "ReadOptionsRef Tests": - test "Test newReadOptions": var readOpts = newReadOptions() @@ -36,4 +33,4 @@ suite "ReadOptionsRef Tests": readOpts.close() check readOpts.isClosed() readOpts.close() - check readOpts.isClosed() \ No newline at end of file + check readOpts.isClosed() diff --git a/tests/options/test_writeopts.nim b/tests/options/test_writeopts.nim index c94021e..38981d0 100644 --- a/tests/options/test_writeopts.nim +++ b/tests/options/test_writeopts.nim @@ -9,12 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/options/writeopts +import unittest2, ../../rocksdb/options/writeopts suite "WriteOptionsRef Tests": - test "Test newWriteOptions": var writeOpts = newWriteOptions() @@ -36,4 +33,4 @@ suite "WriteOptionsRef Tests": writeOpts.close() check writeOpts.isClosed() writeOpts.close() - check writeOpts.isClosed() \ No newline at end of file + check writeOpts.isClosed() diff --git a/tests/test_backup.nim b/tests/test_backup.nim index 376d142..b2ba55a 100644 --- a/tests/test_backup.nim +++ b/tests/test_backup.nim @@ -9,15 +9,9 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/backup, - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/backup, ./test_helper suite "BackupEngineRef Tests": - let key = @[byte(1), 2, 3, 4, 5] val = @[byte(1), 2, 3, 4, 5] @@ -26,18 +20,15 @@ suite "BackupEngineRef Tests": let dbPath = mkdtemp() / "data" dbBackupPath = mkdtemp() / "backup" - dbRestorePath = mkdtemp() / "restore" + dbRestorePath = mkdtemp() / "restore" - var - db = initReadWriteDb(dbPath) + var db = initReadWriteDb(dbPath) teardown: - db.close() removeDir($dbPath) removeDir($dbBackupPath) - test "Test backup": var engine = initBackupEngine(dbBackupPath) diff --git a/tests/test_columnfamily.nim b/tests/test_columnfamily.nim index dfd6fd2..28f6829 100644 --- a/tests/test_columnfamily.nim +++ b/tests/test_columnfamily.nim @@ -9,12 +9,7 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/columnfamily, - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/columnfamily, ./test_helper suite "ColFamily Tests": const @@ -43,8 +38,18 @@ suite "ColFamily Tests": check cf.put(key, val).isOk() var bytes: seq[byte] - check cf.get(key, proc(data: openArray[byte]) = bytes = @data)[] - check not cf.get(otherKey, proc(data: openArray[byte]) = bytes = @data)[] + check cf.get( + key, + proc(data: openArray[byte]) = + bytes = @data + , + )[] + check not cf.get( + otherKey, + proc(data: openArray[byte]) = + bytes = @data + , + )[] var r1 = cf.get(key) check r1.isOk() and r1.value == val diff --git a/tests/test_helper.nim b/tests/test_helper.nim index a844064..940660b 100644 --- a/tests/test_helper.nim +++ b/tests/test_helper.nim @@ -9,50 +9,41 @@ {.used.} -import - std/sequtils, - ../rocksdb/backup, - ../rocksdb/rocksdb, - ../rocksdb/transactiondb - +import std/sequtils, ../rocksdb/backup, ../rocksdb/rocksdb, ../rocksdb/transactiondb proc initReadWriteDb*( - path: string, - columnFamilyNames: openArray[string] = @[]): RocksDbReadWriteRef = - + path: string, columnFamilyNames: openArray[string] = @[] +): RocksDbReadWriteRef = let res = openRocksDb( - path, - columnFamilies = columnFamilyNames.mapIt(initColFamilyDescriptor(it))) + path, columnFamilies = columnFamilyNames.mapIt(initColFamilyDescriptor(it)) + ) if res.isErr(): echo res.error() doAssert res.isOk() res.value() proc initReadOnlyDb*( - path: string, - columnFamilyNames: openArray[string] = @[]): RocksDbReadOnlyRef = - + path: string, columnFamilyNames: openArray[string] = @[] +): RocksDbReadOnlyRef = let res = openRocksDbReadOnly( - path, - columnFamilies = columnFamilyNames.mapIt(initColFamilyDescriptor(it))) + path, columnFamilies = columnFamilyNames.mapIt(initColFamilyDescriptor(it)) + ) if res.isErr(): echo res.error() doAssert res.isOk() res.value() proc initBackupEngine*(path: string): BackupEngineRef = - let res = openBackupEngine(path) doAssert res.isOk() res.value() proc initTransactionDb*( - path: string, - columnFamilyNames: openArray[string] = @[]): TransactionDbRef = - + path: string, columnFamilyNames: openArray[string] = @[] +): TransactionDbRef = let res = openTransactionDb( - path, - columnFamilies = columnFamilyNames.mapIt(initColFamilyDescriptor(it))) + path, columnFamilies = columnFamilyNames.mapIt(initColFamilyDescriptor(it)) + ) if res.isErr(): echo res.error() doAssert res.isOk() diff --git a/tests/test_rocksdb.nim b/tests/test_rocksdb.nim index 4f3d7f4..ef45e1a 100644 --- a/tests/test_rocksdb.nim +++ b/tests/test_rocksdb.nim @@ -9,12 +9,7 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/rocksdb, - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/rocksdb, ./test_helper suite "RocksDbRef Tests": const @@ -36,13 +31,22 @@ suite "RocksDbRef Tests": removeDir($dbPath) test "Basic operations": - var s = db.put(key, val) check s.isOk() var bytes: seq[byte] - check db.get(key, proc(data: openArray[byte]) = bytes = @data)[] - check not db.get(otherKey, proc(data: openArray[byte]) = bytes = @data)[] + check db.get( + key, + proc(data: openArray[byte]) = + bytes = @data + , + )[] + check not db.get( + otherKey, + proc(data: openArray[byte]) = + bytes = @data + , + )[] var r1 = db.get(key) check r1.isOk() and r1.value == val @@ -84,13 +88,24 @@ suite "RocksDbRef Tests": check readOnlyDb.isClosed() test "Basic operations - default column family": - var s = db.put(key, val, CF_DEFAULT) check s.isOk() var bytes: seq[byte] - check db.get(key, proc(data: openArray[byte]) = bytes = @data, CF_DEFAULT)[] - check not db.get(otherKey, proc(data: openArray[byte]) = bytes = @data, CF_DEFAULT)[] + check db.get( + key, + proc(data: openArray[byte]) = + bytes = @data + , + CF_DEFAULT, + )[] + check not db.get( + otherKey, + proc(data: openArray[byte]) = + bytes = @data + , + CF_DEFAULT, + )[] var r1 = db.get(key) check r1.isOk() and r1.value == val @@ -132,7 +147,6 @@ suite "RocksDbRef Tests": check readOnlyDb.isClosed() test "Basic operations - multiple column families": - var s = db.put(key, val, CF_DEFAULT) check s.isOk() @@ -140,12 +154,36 @@ suite "RocksDbRef Tests": check s2.isOk() var bytes: seq[byte] - check db.get(key, proc(data: openArray[byte]) = bytes = @data, CF_DEFAULT)[] - check not db.get(otherKey, proc(data: openArray[byte]) = bytes = @data, CF_DEFAULT)[] + check db.get( + key, + proc(data: openArray[byte]) = + bytes = @data + , + CF_DEFAULT, + )[] + check not db.get( + otherKey, + proc(data: openArray[byte]) = + bytes = @data + , + CF_DEFAULT, + )[] var bytes2: seq[byte] - check db.get(otherKey, proc(data: openArray[byte]) = bytes2 = @data, CF_OTHER)[] - check not db.get(key, proc(data: openArray[byte]) = bytes2 = @data, CF_OTHER)[] + check db.get( + otherKey, + proc(data: openArray[byte]) = + bytes2 = @data + , + CF_OTHER, + )[] + check not db.get( + key, + proc(data: openArray[byte]) = + bytes2 = @data + , + CF_OTHER, + )[] var e1 = db.keyExists(key, CF_DEFAULT) check e1.isOk() and e1.value == true @@ -178,8 +216,8 @@ suite "RocksDbRef Tests": # Open database in read only mode block: - var - readOnlyDb = initReadOnlyDb(dbPath, columnFamilyNames = @[CF_DEFAULT, CF_OTHER]) + var readOnlyDb = + initReadOnlyDb(dbPath, columnFamilyNames = @[CF_DEFAULT, CF_OTHER]) var r = readOnlyDb.keyExists(key, CF_OTHER) check r.isOk() and r.value == false @@ -192,7 +230,6 @@ suite "RocksDbRef Tests": check readOnlyDb.isClosed() test "Close multiple times": - check not db.isClosed() db.close() check db.isClosed() @@ -206,7 +243,13 @@ suite "RocksDbRef Tests": check r.isErr() and r.error() == "rocksdb: unknown column family" var bytes: seq[byte] - let r2 = db.get(key, proc(data: openArray[byte]) = bytes = @data, CF_UNKNOWN) + let r2 = db.get( + key, + proc(data: openArray[byte]) = + bytes = @data + , + CF_UNKNOWN, + ) check r2.isErr() and r2.error() == "rocksdb: unknown column family" let r3 = db.keyExists(key, CF_UNKNOWN) @@ -240,7 +283,12 @@ suite "RocksDbRef Tests": block: var v: seq[byte] - let r = db.get(key1, proc(data: openArray[byte]) = v = @data) + let r = db.get( + key1, + proc(data: openArray[byte]) = + v = @data + , + ) check: r.isOk() r.value() == true @@ -249,7 +297,12 @@ suite "RocksDbRef Tests": block: var v: seq[byte] - let r = db.get(key2, proc(data: openArray[byte]) = v = @data) + let r = db.get( + key2, + proc(data: openArray[byte]) = + v = @data + , + ) check: r.isOk() r.value() == true @@ -258,7 +311,12 @@ suite "RocksDbRef Tests": block: var v: seq[byte] - let r = db.get(key3, proc(data: openArray[byte]) = v = @data) + let r = db.get( + key3, + proc(data: openArray[byte]) = + v = @data + , + ) check: r.isOk() r.value() == true @@ -267,7 +325,12 @@ suite "RocksDbRef Tests": block: var v: seq[byte] - let r = db.get(key4, proc(data: openArray[byte]) = v = @data) + let r = db.get( + key4, + proc(data: openArray[byte]) = + v = @data + , + ) check: r.isOk() r.value() == false @@ -276,7 +339,12 @@ suite "RocksDbRef Tests": block: var v: seq[byte] - let r = db.get(key5, proc(data: openArray[byte]) = v = @data) + let r = db.get( + key5, + proc(data: openArray[byte]) = + v = @data + , + ) check: r.isOk() r.value() == false diff --git a/tests/test_rocksiterator.nim b/tests/test_rocksiterator.nim index 807027e..e422dac 100644 --- a/tests/test_rocksiterator.nim +++ b/tests/test_rocksiterator.nim @@ -9,15 +9,9 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/[rocksdb, rocksiterator], - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/[rocksdb, rocksiterator], ./test_helper suite "RocksIteratorRef Tests": - const CF_DEFAULT = "default" CF_OTHER = "other" @@ -34,8 +28,8 @@ suite "RocksIteratorRef Tests": setup: let dbPath = mkdtemp() / "data" - db = initReadWriteDb(dbPath, - columnFamilyNames = @[CF_DEFAULT, CF_OTHER, CF_EMPTY]) + db = + initReadWriteDb(dbPath, columnFamilyNames = @[CF_DEFAULT, CF_OTHER, CF_EMPTY]) doAssert db.put(key1, val1).isOk() doAssert db.put(key2, val2).isOk() @@ -53,7 +47,8 @@ suite "RocksIteratorRef Tests": check res.isOk() var iter = res.get() - defer: iter.close() + defer: + iter.close() iter.seekToFirst() check iter.isValid() @@ -78,18 +73,24 @@ suite "RocksIteratorRef Tests": check res.isOk() var iter = res.get() - defer: iter.close() + defer: + iter.close() iter.seekToLast() check iter.isValid() var expected = byte(3) while iter.isValid(): - var key: seq[byte] - iter.key(proc(data: openArray[byte]) = key = @data) + iter.key( + proc(data: openArray[byte]) = + key = @data + ) var val: seq[byte] - iter.value(proc(data: openArray[byte]) = val = @data) + iter.value( + proc(data: openArray[byte]) = + val = @data + ) check: key == @[expected] @@ -105,11 +106,13 @@ suite "RocksIteratorRef Tests": let res1 = db.openIterator(CF_DEFAULT) check res1.isOk() var iter1 = res1.get() - defer: iter1.close() + defer: + iter1.close() let res2 = db.openIterator(CF_DEFAULT) check res2.isOk() var iter2 = res2.get() - defer: iter2.close() + defer: + iter2.close() iter1.seekToFirst() check iter1.isValid() @@ -126,11 +129,13 @@ suite "RocksIteratorRef Tests": let res1 = db.openIterator(CF_DEFAULT) check res1.isOk() var iter1 = res1.get() - defer: iter1.close() + defer: + iter1.close() let res2 = db.openIterator(CF_OTHER) check res2.isOk() var iter2 = res2.get() - defer: iter2.close() + defer: + iter2.close() iter1.seekToFirst() check iter1.isValid() @@ -153,7 +158,8 @@ suite "RocksIteratorRef Tests": let res = db.openIterator(CF_EMPTY) check res.isOk() var iter = res.get() - defer: iter.close() + defer: + iter.close() iter.seekToFirst() check not iter.isValid() @@ -165,7 +171,8 @@ suite "RocksIteratorRef Tests": let res = db.openIterator(CF_EMPTY) check res.isOk() var iter = res.get() - defer: iter.close() + defer: + iter.close() check iter.status().isOk() iter.seekToLast() diff --git a/tests/test_sstfilewriter.nim b/tests/test_sstfilewriter.nim index 849eee1..b03343e 100644 --- a/tests/test_sstfilewriter.nim +++ b/tests/test_sstfilewriter.nim @@ -9,15 +9,9 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/[rocksdb, sstfilewriter], - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/[rocksdb, sstfilewriter], ./test_helper suite "SstFileWriterRef Tests": - const CF_DEFAULT = "default" CF_OTHER = "other" @@ -34,8 +28,7 @@ suite "SstFileWriterRef Tests": let dbPath = mkdtemp() / "data" sstFilePath = mkdtemp() / "sst" - db = initReadWriteDb(dbPath, - columnFamilyNames = @[CF_DEFAULT, CF_OTHER]) + db = initReadWriteDb(dbPath, columnFamilyNames = @[CF_DEFAULT, CF_OTHER]) teardown: db.close() @@ -45,7 +38,8 @@ suite "SstFileWriterRef Tests": let res = openSstFileWriter(sstFilePath) check res.isOk() let writer = res.get() - defer: writer.close() + defer: + writer.close() check: writer.put(key1, val1).isOk() @@ -63,7 +57,8 @@ suite "SstFileWriterRef Tests": let res = openSstFileWriter(sstFilePath) check res.isOk() let writer = res.get() - defer: writer.close() + defer: + writer.close() check: writer.put(key1, val1).isOk() diff --git a/tests/test_transactiondb.nim b/tests/test_transactiondb.nim index 03cb66f..a71c5a5 100644 --- a/tests/test_transactiondb.nim +++ b/tests/test_transactiondb.nim @@ -9,15 +9,9 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/[transactiondb], - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/[transactiondb], ./test_helper suite "TransactionDbRef Tests": - const CF_DEFAULT = "default" CF_OTHER = "other" @@ -38,11 +32,11 @@ suite "TransactionDbRef Tests": db.close() removeDir($dbPath) -# test multiple transactions - + # test multiple transactions test "Test rollback using default column family": var tx = db.beginTransaction() - defer: tx.close() + defer: + tx.close() check not tx.isClosed() check: @@ -67,7 +61,8 @@ suite "TransactionDbRef Tests": test "Test commit using default column family": var tx = db.beginTransaction() - defer: tx.close() + defer: + tx.close() check not tx.isClosed() check: @@ -92,7 +87,8 @@ suite "TransactionDbRef Tests": test "Test setting column family in beginTransaction": var tx = db.beginTransaction(columnFamily = CF_OTHER) - defer: tx.close() + defer: + tx.close() check not tx.isClosed() check: @@ -111,13 +107,14 @@ suite "TransactionDbRef Tests": tx.get(key2, CF_OTHER).error() == "" tx.get(key3, CF_OTHER).get() == val3 - test "Test rollback and commit with multiple transactions": var tx1 = db.beginTransaction(columnFamily = CF_DEFAULT) - defer: tx1.close() + defer: + tx1.close() check not tx1.isClosed() var tx2 = db.beginTransaction(columnFamily = CF_OTHER) - defer: tx2.close() + defer: + tx2.close() check not tx2.isClosed() check: diff --git a/tests/test_writebatch.nim b/tests/test_writebatch.nim index b30be4b..3f36cb9 100644 --- a/tests/test_writebatch.nim +++ b/tests/test_writebatch.nim @@ -9,15 +9,9 @@ {.used.} -import - std/os, - tempfile, - unittest2, - ../rocksdb/[rocksdb, writebatch], - ./test_helper +import std/os, tempfile, unittest2, ../rocksdb/[rocksdb, writebatch], ./test_helper suite "WriteBatchRef Tests": - const CF_DEFAULT = "default" CF_OTHER = "other" @@ -40,7 +34,8 @@ suite "WriteBatchRef Tests": test "Test writing batch to the default column family": var batch = db.openWriteBatch() - defer: batch.close() + defer: + batch.close() check not batch.isClosed() check: @@ -68,7 +63,8 @@ suite "WriteBatchRef Tests": test "Test writing batch to column family": var batch = db.openWriteBatch() - defer: batch.close() + defer: + batch.close() check not batch.isClosed() check: @@ -95,7 +91,8 @@ suite "WriteBatchRef Tests": test "Test writing to multiple column families in single batch": var batch = db.openWriteBatch() - defer: batch.close() + defer: + batch.close() check not batch.isClosed() check: @@ -124,11 +121,13 @@ suite "WriteBatchRef Tests": test "Test writing to multiple column families in multiple batches": var batch1 = db.openWriteBatch() - defer: batch1.close() + defer: + batch1.close() check not batch1.isClosed() var batch2 = db.openWriteBatch() - defer: batch2.close() + defer: + batch2.close() check not batch2.isClosed() check: @@ -157,7 +156,8 @@ suite "WriteBatchRef Tests": const CF_UNKNOWN = "unknown" var batch = db.openWriteBatch() - defer: batch.close() + defer: + batch.close() check not batch.isClosed() let r = batch.put(key1, val1, CF_UNKNOWN) @@ -168,7 +168,8 @@ suite "WriteBatchRef Tests": test "Test write empty batch": var batch = db.openWriteBatch() - defer: batch.close() + defer: + batch.close() check not batch.isClosed() check batch.count() == 0 @@ -184,4 +185,4 @@ suite "WriteBatchRef Tests": batch.close() check batch.isClosed() batch.close() - check batch.isClosed() \ No newline at end of file + check batch.isClosed() diff --git a/tests/transactions/test_txdbopts.nim b/tests/transactions/test_txdbopts.nim index 15c82ed..47574e7 100644 --- a/tests/transactions/test_txdbopts.nim +++ b/tests/transactions/test_txdbopts.nim @@ -9,12 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/transactions/txdbopts +import unittest2, ../../rocksdb/transactions/txdbopts suite "TransactionDbOptionsRef Tests": - test "Test newTransactionDbOptions": var txDbOpts = newTransactionDbOptions() @@ -36,4 +33,4 @@ suite "TransactionDbOptionsRef Tests": txDbOpts.close() check txDbOpts.isClosed() txDbOpts.close() - check txDbOpts.isClosed() \ No newline at end of file + check txDbOpts.isClosed() diff --git a/tests/transactions/test_txopts.nim b/tests/transactions/test_txopts.nim index 6aadedf..3e853e8 100644 --- a/tests/transactions/test_txopts.nim +++ b/tests/transactions/test_txopts.nim @@ -9,12 +9,9 @@ {.used.} -import - unittest2, - ../../rocksdb/transactions/txopts +import unittest2, ../../rocksdb/transactions/txopts suite "TransactionOptionsRef Tests": - test "Test newTransactionOptions": var txOpts = newTransactionOptions() @@ -36,4 +33,4 @@ suite "TransactionOptionsRef Tests": txOpts.close() check txOpts.isClosed() txOpts.close() - check txOpts.isClosed() \ No newline at end of file + check txOpts.isClosed()