@ethereumjs/util / MapDB
Defined in: packages/util/src/mapDB.ts:5
TKey
extends Uint8Array
| string
| number
TValue
extends Uint8Array
| string
| DBObject
DB
<TKey
, TValue
>new MapDB<
TKey
,TValue
>(database?
):MapDB
<TKey
,TValue
>
Defined in: packages/util/src/mapDB.ts:12
Map
<TKey
, TValue
>
MapDB
<TKey
, TValue
>
_database:
Map
<TKey
,TValue
>
Defined in: packages/util/src/mapDB.ts:10
batch(
opStack
):Promise
<void
>
Defined in: packages/util/src/mapDB.ts:31
Performs a batch operation on db.
BatchDBOp
<TKey
, TValue
>[]
A stack of levelup operations
Promise
<void
>
del(
key
):Promise
<void
>
Defined in: packages/util/src/mapDB.ts:26
Removes a raw value in the underlying db.
TKey
Promise
<void
>
get(
key
):Promise
<undefined
|TValue
>
Defined in: packages/util/src/mapDB.ts:16
Retrieves a raw value from db.
TKey
Promise
<undefined
| TValue
>
A Promise that resolves to Uint8Array
if a value is found or undefined
if no value is found.
open():
Promise
<void
>
Defined in: packages/util/src/mapDB.ts:52
Opens the database – if applicable
Promise
<void
>
put(
key
,val
):Promise
<void
>
Defined in: packages/util/src/mapDB.ts:21
Writes a value directly to db.
TKey
The key as a TValue
TValue
Promise
<void
>
shallowCopy():
DB
<TKey
,TValue
>
Defined in: packages/util/src/mapDB.ts:48
Note that the returned shallow copy will share the underlying database with the original
DB
<TKey
, TValue
>
DB