diff --git a/rocksdb/rocksdb.nim b/rocksdb/rocksdb.nim index 70f120f..638db93 100644 --- a/rocksdb/rocksdb.nim +++ b/rocksdb/rocksdb.nim @@ -236,9 +236,6 @@ proc get*( ## The `onData` callback reduces the number of copies and therefore should be ## preferred if performance is required. - if key.len() == 0: - return err("rocksdb: key is empty") - var len: csize_t errors: cstring @@ -283,9 +280,6 @@ proc put*( ): RocksDBResult[void] = ## Put the value for the given key into the specified column family. - if key.len() == 0: - return err("rocksdb: key is empty") - var errors: cstring rocksdb_put_cf( db.cPtr, @@ -351,9 +345,6 @@ proc delete*( ## 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`. - if key.len() == 0: - return err("rocksdb: key is empty") - var errors: cstring rocksdb_delete_cf( db.cPtr, diff --git a/rocksdb/transactions/transaction.nim b/rocksdb/transactions/transaction.nim index 41332e3..65cc4c9 100644 --- a/rocksdb/transactions/transaction.nim +++ b/rocksdb/transactions/transaction.nim @@ -69,9 +69,6 @@ proc get*( ## Get the value for a given key from the transaction using the provided ## `onData` callback. - if key.len() == 0: - return err("rocksdb: key is empty") - var len: csize_t errors: cstring @@ -114,9 +111,6 @@ proc put*( ): RocksDBResult[void] = ## Put the value for the given key into the transaction. - if key.len() == 0: - return err("rocksdb: key is empty") - var errors: cstring rocksdb_transaction_put_cf( tx.cPtr, @@ -140,9 +134,6 @@ proc delete*( ): RocksDBResult[void] = ## Delete the value for the given key from the transaction. - if key.len() == 0: - return err("rocksdb: key is empty") - var errors: cstring rocksdb_transaction_delete_cf( tx.cPtr, diff --git a/rocksdb/writebatch.nim b/rocksdb/writebatch.nim index 7126575..c065dbd 100644 --- a/rocksdb/writebatch.nim +++ b/rocksdb/writebatch.nim @@ -51,9 +51,6 @@ proc put*( ): RocksDBResult[void] = ## Add a put operation to the write batch. - if key.len() == 0: - return err("rocksdb: key is empty") - rocksdb_writebatch_put_cf( batch.cPtr, cfHandle.cPtr, @@ -74,9 +71,6 @@ proc delete*( ): RocksDBResult[void] = ## Add a delete operation to the write batch. - if key.len() == 0: - return err("rocksdb: key is empty") - rocksdb_writebatch_delete_cf( batch.cPtr, cfHandle.cPtr, cast[cstring](unsafeAddr key[0]), csize_t(key.len) ) diff --git a/rocksdb/writebatchwi.nim b/rocksdb/writebatchwi.nim index fe7fdaf..e251f0f 100644 --- a/rocksdb/writebatchwi.nim +++ b/rocksdb/writebatchwi.nim @@ -65,9 +65,6 @@ proc put*( ): RocksDBResult[void] = ## Add a put operation to the write batch. - if key.len() == 0: - return err("rocksdb: key is empty") - rocksdb_writebatch_wi_put_cf( batch.cPtr, cfHandle.cPtr, @@ -88,9 +85,6 @@ proc delete*( ): RocksDBResult[void] = ## Add a delete operation to the write batch. - if key.len() == 0: - return err("rocksdb: key is empty") - rocksdb_writebatch_wi_delete_cf( batch.cPtr, cfHandle.cPtr, cast[cstring](unsafeAddr key[0]), csize_t(key.len) ) @@ -106,9 +100,6 @@ proc get*( ## Get the value for a given key from the batch using the provided ## `onData` callback. - if key.len() == 0: - return err("rocksdb: key is empty") - var len: csize_t errors: cstring