Commit Graph

24 Commits

Author SHA1 Message Date
web3-developer cf1267e845
Add support for optimistic transaction db, write batch with index, keyMayExist and empty keys. (#63)
* Add support for optimistic transaction db.

* Add keyMayExist to RocksDbRef.

* Add support for write batch with index.

* Allow empty keys to be used in API.
2024-07-08 22:18:30 +08:00
web3-developer a691d5b9d2
Format using nph (#54)
* Format entire project using nph.

* Add nph lint to CI.
2024-06-26 23:00:10 +08:00
web3-developer 90027f1875
Support for static linking RocksDb. (#40)
* Added rocksdb as a submodule in vendor directory.

* Add support for static linking using nimble.

* Add script to build static library dependencies.

* Disable warnings as error in deps build.

* Set recommended compression options in build and in library.

* Move static linking into wrapper code.

* Conditionally set linker using when defined(macosx).

* Add support for linking windows static libraries.

* Build rocksdb static libs using vcpkg.

* Remove lib prefix from library names for windows.

* Static linking is not supported on windows. Update documentation and CI.
2024-03-27 14:18:21 +08:00
web3-developer 5f6282e8d4
Rocksdb rewrite integration (#38)
* Column families support (#34)

* Update library to support column families. If not specified, uses the 'default' column family.

* Added tests for column family changes.

* Update library version and readme.

* Updated the librocksdb c library to the latest stable version.

* Started rewrite of library.

* Commit library rewrite progress.

* Completed initial rewrite and refactored tests.

* Completed implementation of backup engine.

* Added tests for new types.

* Completed tests for existing features.

* Remove features not supported by older versions of RocksDB to fix CI (temporary fix).

* Remove flush before backup support from BackupEngine to fix CI.

* Transactions support (#36)

* Update library to support column families. If not specified, uses the 'default' column family.

* Added tests for column family changes.

* Update library version and readme.

* Updated the librocksdb c library to the latest stable version.

* Started rewrite of library.

* Commit library rewrite progress.

* Completed initial rewrite and refactored tests.

* Completed implementation of backup engine.

* Added tests for new types.

* Completed tests for existing features.

* Remove features not supported by older versions of RocksDB to fix CI (temporary fix).

* Remove flush before backup support from BackupEngine to fix CI.

* Implemented RocksDB iterator.

* Implemented pairs iterator.

* Completed implementation of WriteBatch with tests.

* Fix example code.

* Completed implementation of TransactionDb.

* Support setting default column family.

* Remove unneeded usage of var for ref type parameters.

* Completed transactiondb tests.

* Improve and refactor rocksdb test.

* Added support for ingesting sst files using the SstFileWriter. (#37)

* Create ColFamilyReadOnly and ColFamilyReadWrite types for using a specific column family.

* Use inline pragma for small procs and add lock to RocksDbRef type close to prevent double free.

* Added documentation for the public API.

* Initial implementation of sst filewriter.

* Added tests for sstfilewriter.

* Documentation minor improvements.
2024-03-05 11:12:37 +08:00
andri lim 5e2b026f84
Fix broken CI (#35)
* Remove appveyor and travis scripts

* Fix broken CI

* Fix set pointer field to nil with typed nil

* Add liblz4 in CI deps of linux i386
2024-02-13 20:59:41 +07:00
Adam Spitz 724b72fe10
Made del return a bool, and added clear. (#33)
* Made del return a bool, and added clear.

What I've done here feels very awkward. Maybe I'm missing something,
but it looks to me like RocksDB doesn't support these operations in
any natural way.

These changes were made in order to get our implementation of
KvStoreRef for RocksDB working again after these changes to the
KvStoreRef interface:

8f0ae55353

I don't really recommend merging this; I think I'd prefer to just stop
trying to use this common KvStoreRef interface.

Still, if we do want to keep the common interface, I think this commit
will work well enough.

* Updated the tests to expect del to return a bool too.

* Leave the new `clear` operation unimplemented.
2023-01-17 11:37:10 -05:00
Jordan Hrycaj b7f0728225
Allow access to some details of the DB driver (#31)
why:
  Playing with SST direct import
2022-08-11 09:13:10 +01:00
Jacek Sieka e528ee949a
get with callback (#22)
* get with callback

avoids seq copy sometimes

* comment on defect exception safety
2020-04-23 20:55:21 +02:00
Jacek Sieka 8da2f11951
nim 1.2, port to results (#21) 2020-04-18 00:18:04 +02:00
kdeme a48aaf2215
Allow setting max open files in RocksDbInstance init 2019-07-16 15:51:52 +02:00
Jacek Sieka 60faf6af17
std_shims -> stew 2019-07-07 12:11:27 +02:00
andri lim 22ab21a5ef add readonly option 2019-04-01 11:29:19 +03:00
Ștefan Talpalaru 2e858e6b9a
assert() -> doAssert() 2019-03-14 00:12:27 +01:00
Ștefan Talpalaru 0860aee591 tests refactoring
- added "--threads:on"
- fixed the Nim API tests and moved them to unittest
- added copyright header
- combined the 2 test file into tests/all.nim and set that as the
  Nimble test target
- had Travis run that
- new "tempfile" dependency to create proper tempfiles + deleting them
  at the end
- copied the error string to RocksDBResult
2019-01-20 11:45:52 +02:00
Yuriy Glukhov 1edab645d9 Distinguish empty values from non existent 2018-09-07 16:30:36 +03:00
Jacek Sieka e48a45bd44
reuse read and write options
* fixes segfault in del
* fixes initResource freeing options before they get used
* fixes failing test cases
* avoids reallocating options on every access
* deallocates fields in reverse creation order
2018-08-16 09:13:13 -06:00
Jacek Sieka 0f6b9ffe8f
disable optimization that requires snappy
this causes early test failures when rocksdb is compiled without it
2018-08-15 20:08:03 -06:00
Jacek Sieka 4b73bca449
fix error parameter type and memory leak
* error is a pointer to a cstring that the API will allocate on error
* if an error is returned, it must be free'd
* note missing tests for when error happens
2018-08-15 19:56:18 -06:00
Jacek Sieka d510091a5b
fix string conversion for void results
value does not exist for void
2018-08-15 19:52:53 -06:00
Yuriy Glukhov 291621b828 Mooore type safety 2018-07-30 19:34:36 +03:00
Yuriy Glukhov ba0aa8e5db Dry up types and pragmas 2018-07-30 12:12:50 +03:00
Yuriy Glukhov 840d470eb9 Fixed pkg struct (#5) 2018-07-04 14:09:03 +02:00
mratsim 5fea270681 Fix simple import (mangle rules + opaque type definition) 2018-01-27 16:08:45 +01:00
mratsim 19655472eb Add wrapper for RocksDB C API 2018-01-27 15:03:19 +01:00