Skip to main content

kwil-cli database query

kwil-cli database query

Query a database using an ad-hoc SQL SELECT statement.

Synopsis

Query a database using an ad-hoc SQL SELECT statement.

Requires a SQL SELECT statement as an argument.

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.

Note that ad-hoc queries will be rejected on RPC servers that are operating with authenticated call requests enabled.

kwil-cli database query <select_statement> [flags]

Examples

# Querying the "users" table in the "mydb" database
kwil-cli database query "SELECT * FROM users WHERE age > 25" --name mydb --owner 0x9228624C3185FCBcf24c1c9dB76D8Bef5f5DAd64

Options

  -i, --dbid string    the target database id
-h, --help help for query
-n, --name string the target database name
-o, --owner string the target database owner

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.