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) or RunSQL (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

RawClient.list_databases, RawClient.get_table

RawClient.ListDatabases, RawClient.GetTable

Database and table metadata

Execute a fully qualified SQL statement

SDKClient.run_sql

SDKClient.RunSQL

SQL queries and results

Save a workbook or retrieve query history

Not exposed by the public SDK

Not exposed by the public SDK

Workbook and history boundary

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

  1. Select a catalog and list its databases.

  2. Inspect the target table and confirm its column names and types.

  3. Build a statement with a fully qualified table name.

  4. Execute the statement and handle API or transport errors.

  5. 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.