kwil-cli database execute
kwil-cli database execute
Execute an action against a database.
Synopsis
Execute an action against a database.
The action name is specified as a required "--action" flag, and the action parameters as arguments. In order to specify an action parameter, you first need to specify the parameter name, then the parameter value, delimited by a colon.
For example, for action get_user($username)
, you would specify the action as follows:
username:satoshi
--action=get_user
You can either specify the database to execute this against with the --name
and --owner
flags, or you can specify the database by passing the database id with the --dbid
flag. If a --name
flag is passed and no --owner
flag is passed, the owner will be inferred from your configured wallet.
kwil-cli database execute <parameter_1:value_1> <parameter_2:value_2> ... [flags]
Examples
# Executing the `create_user($username, $age)` action on the "mydb" database
kwil-cli database execute username:satoshi age:32 --action create_user --name mydb --owner 0x9228624C3185FCBcf24c1c9dB76D8Bef5f5DAd64
# Executing the `create_user($username, $age)` action on a database using a dbid
kwil-cli database execute username:satoshi age:32 --action create_user --dbid 0x9228624C3185FCBcf24c1c9dB76D8Bef5f5DAd64
Options
-a, --action string the target action name (required)
-i, --dbid string the target database id
-h, --help help for execute
-n, --name string the target database name
-N, --nonce int nonce override (-1 means request from server) (default -1)
-o, --owner string the target database owner
--sync synchronous broadcast (wait for it to be included in a block)
Options inherited from parent commands
-Y, --assume-yes Assume yes for all prompts
--chain-id string the expected/intended Kwil Chain ID
--config string the path to the Kwil CLI persistent global settings file (default "/Users/brennanlamey/.kwil-cli/config.json")
--output string the format for command output - either 'text' or 'json' (default "text")
--private-key string the private key of the wallet that will be used for signing
--provider string the Kwil provider RPC endpoint (default "http://127.0.0.1:8484")
-S, --silence Silence logs
SEE ALSO
- kwil-cli database - The database command is a parent command containing subcommands for interacting with databases.