SQL¶
The public MOI Python and Go SDKs expose two SQL-related capabilities:
inspect catalog, database, and table metadata through the low-level client; and
execute a SQL statement through the high-level
run_sql(Python) orRunSQL(Go) helper.
The execution helper uses the Catalog service’s NL2SQL run_sql operation. It
is not a general database driver: it does not open a SQL session or provide a
transaction object. Table names in the statement must be fully qualified as
database.table.
Choose the right API¶
Goal |
Python |
Go |
Read next |
|---|---|---|---|
List databases or inspect a table schema |
|
|
|
Execute a fully qualified SQL statement |
|
|
|
Save a workbook or retrieve query history |
Not exposed by the public SDK |
Not exposed by the public SDK |
Start with the Python quickstart or Go quickstart to create a client. The examples in this section assume that the service base URL, API key, and required catalog object IDs come from configuration or an earlier SDK response.
Typical flow¶
Select a catalog and list its databases.
Inspect the target table and confirm its column names and types.
Build a statement with a fully qualified table name.
Execute the statement and handle API or transport errors.
If the application needs saved SQL or an audit trail, persist that application state separately; the public SDK does not create SQL Editor workbooks or read SQL History.
For interactive exploration in AI Studio, use the SQL editor. For operator-facing execution records, see SQL History. Those UI features should not be treated as public SDK methods.