db
The db group runs read-only SQL queries against a brick database. It is intended primarily for inspecting the lab databases — browsing schema and data — without any risk of modifying them. Start with gws db list to discover the available databases, then use gws db query to explore one. Queries default to the gws_core database; target another brick's database with --db.
db query
Executes a read-only SQL statement against a brick database and prints the result. The database is selected with --db (defaulting to gws_core), output can be rendered as an aligned table or as JSON, and the number of rows printed is capped with --limit. Only read-only statements are accepted — see the note below.
gws db query [OPTIONS]
# List the tables of a brick database
gws db query "SHOW TABLES" --db gws_invest
# Inspect a table's structure
gws db query "DESCRIBE invest_investor" --db gws_invest
# Read rows as JSON with no row cap
gws db query "SELECT * FROM invest_investor" --db gws_invest --format json --limit 0
db list
Lists the available brick databases. Each listed name can be passed to gws db query --db <name> to target that database. When --db is omitted, queries run against gws_core.
gws db list [OPTIONS]
# List every available brick database
gws db list