connect_sync
relationalai.client
connect_sync( *, config: "Config | None" = None, connection_name: str | None = None, token: str | None = None) -> ClientSyncSynchronous entrypoint returning a ClientSync.
Use this from synchronous code. The returned ClientSync:
- exposes sync lifecycle (
client.close()/with ...) - exposes synchronous service clients (e.g.
client.reasoners->ReasonersClientSync)
Transport creation is lazy: no network calls are made by connect_sync(...) itself.
Transports are created on first use (SQL/HTTP/services).
This function raises if called while an event loop is already running in the
current thread (use await connect(...) from async code instead).
Parameters
Section titled “Parameters”
(config‘Config|None’, default:None) - Optional config to use. When omitted, a default config is loaded.
(connection_namestr|None, default:None) - Optional named connection to use from the config.
(tokenstr|None, default:None) - Optional RAI token override.
Returns
Section titled “Returns”ClientSync- A synchronous root client. Usewith connect_sync(...) as client:orclient = connect_sync(...); client.close().
Referenced By
Section titled “Referenced By”RelationalAI Documentation └── Manage the RAI Native App for Snowflake ├── Manage the RAI Native App’s SPCS Service │ └── Service Management ├── Manage the RAI Native App’s Compute Resources │ └── Reasoner Management ├── Manage Data Shared With the RAI Native App │ ├── The CDC Service │ └── Data Stream Management └── Upgrade the RAI Native App ├── Automatic Upgrades └── Manual Reasoner Upgrades