Skip to content

Commit

Permalink
Completed initial rewrite and refactored tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhartnett committed Feb 19, 2024
1 parent 656e521 commit 2fbbe53
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 465 deletions.
4 changes: 2 additions & 2 deletions rocksdb.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#
# at your option. This file may not be copied, modified, or distributed except according to those terms.

import ./rocksdb/[rocksdb_old, rocksdb]
import ./rocksdb/[rocksdb]

export rocksdb_old, rocksdb
export rocksdb
2 changes: 1 addition & 1 deletion rocksdb/columnfamily/cfdescriptor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import
./cfopts

const DEFAULT_COLUMN_FAMILY_NAME* = "default"
export cfopts

type
ColFamilyDescriptor* = object
Expand Down
8 changes: 3 additions & 5 deletions rocksdb/columnfamily/cfhandle.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
{.push raises: [].}

import
../lib/librocksdb,
./cfdescriptor
../lib/librocksdb

const DEFAULT_COLUMN_FAMILY_NAME* = "default"

type
ColFamilyHandlePtr* = ptr rocksdb_column_family_handle_t
Expand Down Expand Up @@ -41,9 +42,6 @@ proc getName*(handle: ColFamilyHandleRef): string =
template isDefault*(handle: ColFamilyHandleRef): bool =
handle.getName() == DEFAULT_COLUMN_FAMILY_NAME

# proc getDescriptor*(handle: ColFamilyHandleRef): ColumnFamilyDescriptor =
# doAssert not handle.isClosed()

proc close*(handle: var ColFamilyHandleRef) =
if not handle.isClosed():
rocksdb_column_family_handle_destroy(handle.cPtr)
Expand Down
2 changes: 1 addition & 1 deletion rocksdb/options/dbopts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ proc setCreateIfMissing*(dbOpts: var DbOptionsRef, flag: bool) =
rocksdb_options_set_create_if_missing(dbOpts.cPtr, flag.uint8)

proc setMaxOpenFiles*(dbOpts: var DbOptionsRef, maxOpenFiles: int) =
doAssert maxOpenFiles > -1
doAssert maxOpenFiles >= -1
doAssert not dbOpts.isClosed()
rocksdb_options_set_max_open_files(dbOpts.cPtr, maxOpenFiles.cint)

Expand Down
Loading

0 comments on commit 2fbbe53

Please sign in to comment.