`homeboy db`
Synopsis
sh
homeboy db <COMMAND>Subcommands
tables
sh
homeboy db tables <project_id> [<subtarget>] [<args...>]describe
sh
homeboy db describe <project_id> [<subtarget>] <table>Notes:
- Subtargets are only recognized if the project has
sub_targetsconfigured. - The first trailing arg is treated as
<subtarget>if it matches by slug or name; otherwise it is treated as the<table>.
query
sh
homeboy db query <project_id> [<subtarget>] <sql...>Note: query is intended for SELECT-only operations. Non-SELECT statements are rejected.
search
sh
homeboy db search <project_id> <table> --column <column> --pattern <pattern> [options]Options:
--column <name>(required): Column to search--pattern <value>(required): Search pattern (LIKE match by default)--exact: Use exact match (=) instead of LIKE--limit <n>: Maximum rows to return (default: 100)--subtarget <name>: Optional subtarget
Examples:
sh
# Find users with email containing "gmail"
homeboy db search mysite wp_users --column user_email --pattern gmail
# Find posts with exact status
homeboy db search mysite wp_posts --column post_status --exact --pattern publishdelete-row
sh
homeboy db delete-row <project_id> [<subtarget>] <table> <row_id>Notes:
<row_id>must be numeric.
drop-table
sh
homeboy db drop-table <project_id> [<subtarget>] <table>tunnel
sh
homeboy db tunnel <project_id> [--local-port <port>]JSON output
Note: all command output is wrapped in the global JSON envelope described in the JSON output contract.
homeboy dbreturns aDbOutputobject as thedatapayload. Fields vary by action.
Note: all command output is wrapped in the global JSON envelope described in the JSON output contract. homeboy db returns a DbOutput object as the data payload. Fields vary by action.
command:db.tables|db.describe|db.query|db.search|db.delete_row|db.drop_table|db.tunnelproject_idexit_code,successstdout,stderr(for remote command execution)
Note: all command output is wrapped in the global JSON envelope described in the JSON output contract. homeboy db returns a DbOutput object as the data payload. Fields vary by action.
tables(fordb.tables)table(fordescribe,delete_row,drop_table)sql(forquery,delete_row,drop_table)tunnel(fortunnel):{ local_port, remote_host, remote_port, database, user }
Exit code
- For remote-command actions: exit code of the underlying remote database CLI command (as defined by the enabled extension’s
database.clitemplates). - For
tunnel: exit code of the localssh -Lprocess.