kwil-cli exec-action
kwil-cli exec-action
Execute an action against the database.
Synopsis
Execute an action against the database.
This command executes an action against the database. It is meant to only call actions that write to the database, and will not return any results from the action. If you need to see results, use the 'call-action' command instead.
This command requires a private key, and it will author a transaction from the private key to the network.
Actions can be given any mix of positional and named parameters in order to execute an action one. If you wish to batch execute an action, you can provide a CSV file, and map the CSV column names to either the action parameter name or the action parameter position. If any named parameters are specified while using a CSV file, then all batch action calls will set the named parameter to the same value.
kwil-cli exec-action [flags]
Examples
# Execute the action 'register' with no parameters
kwil-cli exec-action register
# Execute the action 'register' with a positional parameter
kwil-cli exec-action register text:satoshi
# Execute the action 'register' with a one positional parameter and one named parameter
# Assume the action signature REGISTER($name text, $age int)
kwil-cli exec-action register text:satoshi --param age:int=30
# Execute the action 'register' with a CSV file
# Assume the action signature REGISTER($name text, $age int), and
# the CSV file has the following contents:
# name,age
# satoshi,30
kwil-cli exec-action register --csv /path/to/file.csv --csv-mapping name:0 --csv-mapping age:1
# Execute the action 'register' with a CSV file, but override all ages to be 10
# Assume the same action signature and CSV file as above
kwil-cli exec-action register --csv /path/to/file.csv --csv-mapping name:0 --param age:int=10
Options
--csv string CSV file containing the parameters to pass to the action
-m, --csv-mapping stringArray mapping of CSV columns to action parameters. format: "csv_column:action_param_name" OR "csv_column:action_param_position"
-h, --help help for exec-action
-n, --namespace string namespace to execute the action in
-N, --nonce int nonce override (-1 means request from server) (default -1)
-p, --param stringArray named parameters that will override any positional or CSV parameters. format: "name:type=value"
--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
-c, --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 - Command line interface client for using Kwil.