Query APIs
Database Info

Database Info

💡

db is assumed to be the state variable storing the WeaveDB SDK object. For reference, see Initialize WeaveDB

getInfo

Get general information about your database.

await db.getInfo()

getVersion

Get contract version of your database.

await db.getVersion()

getHash

Get current hash of chained txs.

💡

WeaveDB contracts keep track of valid transactions by hashing chained txIds like a blockchain.
latest_hash = hash( [ last_hash, current_txId ] )

await db.getHash()

getEvolve

To get the stats related to evolve, use getEvolve.

await db.getEvolve()
// { canEvolve, history, evolve, isEvolving }

getOwner

Get contract owners of your database.

await db.getOwner()

getSchema

Get the schema of a collection

await db.getSchema(collection_name)

getCrons

await db.getCrons()

getRelayerJob

await db.getRelayerJob("your_jobID")

listRelayerJobs

await db.listRelayerJobs()