Module db

Module db 

Source
Expand description

Database functions

Functionsยง

db_contains_key
Check if a key is contained in the on-chain key-value store given a DbHandle and key.
db_contains_key_ ๐Ÿ”’ โš 
db_contains_key_internal ๐Ÿ”’
Internal function for db_contains_key which branches to either on-chain or transaction-local.
db_contains_key_local
Check if a key is contained in the tx-local key-value store given a DbHandle and key.
db_contains_key_local_ ๐Ÿ”’ โš 
db_del
Remove a key from the on-chain database given a DbHandle and key.
db_del_ ๐Ÿ”’ โš 
db_del_internal ๐Ÿ”’
Internal function for db_del which branches to either on-chain or transaction-local.
db_del_local
Remove a key from the tx-local database given a DbHandle and key.
db_del_local_ ๐Ÿ”’ โš 
db_get
Read a key from the on-chain key-value store given a DbHandle and key.
db_get_ ๐Ÿ”’ โš 
db_get_internal ๐Ÿ”’
Internal function for db_get which branches to either on-chain or transaction-local.
db_get_local
Read a key from the tx-local key-value store given a DbHandle and key.
db_get_local_ ๐Ÿ”’ โš 
db_init
Create a new on-chain database instance for the given contract. A contract is only able to create a db for itself.
db_init_ ๐Ÿ”’ โš 
db_lookup
Open an existing on-chain database instance for the given contract. A contract is able to read any on-chain database.
db_lookup_ ๐Ÿ”’ โš 
db_lookup_internal ๐Ÿ”’
Internal function for db_lookup which branches to either on-chain or transaction-local.
db_lookup_local
Open a tx-local database instance for the given contract. A contract is able to read any tx-local database.
db_lookup_local_ ๐Ÿ”’ โš 
db_set
Set a key and value in the on-chain database for the given DbHandle.
db_set_ ๐Ÿ”’ โš 
db_set_internal ๐Ÿ”’
Internal function for db_set which branches to either on-chain or transaction-local.
db_set_local
Set a key and value in the tx-local database for the given DbHandle.
db_set_local_ ๐Ÿ”’ โš 
zkas_db_set
Given a zkas circuit, create a VerifyingKey and insert them both into the on-chain db.
zkas_db_set_ ๐Ÿ”’ โš 

Type Aliasesยง

DbHandle