@ethereumjs/util / DB
Name | Type |
---|---|
TKey |
extends Uint8Array | string | number = Uint8Array |
TValue |
extends Uint8Array | string | DBObject = Uint8Array |
▸ batch(opStack
): Promise
<void
>
Performs a batch operation on db.
Name | Type | Description |
---|---|---|
opStack |
BatchDBOp <TKey , TValue >[] |
A stack of levelup operations |
Promise
<void
>
▸ del(key
, opts?
): Promise
<void
>
Removes a raw value in the underlying db.
Name | Type |
---|---|
key |
TKey |
opts? |
EncodingOpts |
Promise
<void
>
▸ get(key
, opts?
): Promise
<undefined
| TValue
>
Retrieves a raw value from db.
Name | Type |
---|---|
key |
TKey |
opts? |
EncodingOpts |
Promise
<undefined
| TValue
>
A Promise that resolves to Uint8Array
if a value is found or undefined
if no value is found.
▸ open(): Promise
<void
>
Opens the database – if applicable
Promise
<void
>
▸ put(key
, val
, opts?
): Promise
<void
>
Writes a value directly to db.
Name | Type | Description |
---|---|---|
key |
TKey |
The key as a TValue |
val |
TValue |
- |
opts? |
EncodingOpts |
- |
Promise
<void
>
▸ shallowCopy(): DB
<TKey
, TValue
>
Returns a copy of the DB instance, with a reference to the same underlying db instance.
DB
<TKey
, TValue
>