SQL tasks¶
Use sql to browse metadata, manage workbooks, run SQL, and view results and SQL history.
moi-cli -o sql meta-databases
moi-cli -o sql execute-query --query "SELECT 1"
moi-cli sql --help
Before running SQL, confirm the target workspace and database. Write, delete, and DDL statements affect data; after submitting a query, use query-result, query-detail, or query-history to read later results instead of treating the acceptance response as completion.
Manage workbooks and versions¶
Task |
Commands |
Notes |
|---|---|---|
Inspect workbooks and versions |
|
Read the workbook and version identifiers before a write. |
Manage workbooks |
|
Confirm dependencies and impact before deletion. |
Manage workbook versions |
|
Use confirmed workbook and version identifiers. |
Creating, updating, or deleting workbooks and versions writes resources. Read workbook details and the version list first, then use the subcommand’s -help output to provide workbook IDs, version IDs, and SQL content. Do not build query text by shell concatenation.
Inspect query state and metadata¶
Task |
Commands |
Notes |
|---|---|---|
Submit or cancel a query |
|
Do not treat acceptance as completion; cancel only a query that can still be cancelled. |
Inspect query state and results |
|
Use the query identifier to read later state and results. |
Inspect query history |
|
Reads previously executed records. |
Inspect metadata |
|
Confirm database, table, and column information first. |
Delete metadata objects |
|
Confirm object path, dependencies, and scope before running the command. |