Skip to content

RelationalAI SQL API Reference

The RelationalAI (RAI) SQL API is a set of stored procedures and views that allow you to operate and manage the RAI Native App and its resources. These procedures and views are available in the RELATIONALAI database created when you install the RAI Native App.

Use the following procedures to activate, deactivate, and monitor the RAI Native App’s status:

NameDescription
app.activate()Activates the app.
app.deactivate()Deactivates the app.
app.get_service()Gets details about the app’s SPCS service.
app.service_status()Gets the status of the app’s SPCS service.
app.get_release()Gets the current version of the app.
app.drop_service()Stops and drops the RAI service.

See App Management for more information.

See Compute Resources for more information.

Use the following to manage reasoners used by the RAI Native App:

NameDescription
api.reasonersLists all reasoners.
api.create_reasoner()Creates a new reasoner.
api.get_reasoner()Gets details for a specified reasoner.
api.delete_reasoner()Deletes an existing reasoner.
api.suspend_reasoner()Suspends a reasoner.
api.resume_reasoner_async()Resumes a suspended reasoner without blocking.
api.alter_reasoner_auto_suspend_mins()Sets the auto-suspend time for a reasoner.
api.alter_reasoner_pool_node_limits()Updates compute pool node limits for reasoners of a specified type and size.
app.enable_warm_reasoner()Enables warm reasoners for a specified reasoner type and size.
app.disable_warm_reasoner()Disables warm reasoners for a specified reasoner type and size.

See Compute Resources for more information.

Use the following to manage the RAI Native App’s CDC Service:

NameDescription
app.resume_cdc()Enables the CDC Service.
app.suspend_cdc()Disables the CDC Service.
app.cdc_status()Retrieves the status of the CDC Service.
app.alter_cdc_engine_size()Configures the size of the CDC engine.

See Data Management for more information.

Use these procedures to manage the data streams that share Snowflake data with the RAI Native App:

NameDescription
api.data_streamsLists all data streams.
api.data_stream_batchesShows the status of data stream batches.
api.data_stream_errorsShows CDC-related errors and logs for data stream processing.
api.create_data_stream()Creates a new data stream.
api.suspend_data_stream()Suspends a data stream.
api.resume_data_stream()Resumes a suspended data stream.
api.delete_data_stream()Deletes an existing data stream.
api.get_data_stream()Retrieves details for a specified data stream.
api.object_reference()Creates a Snowflake object reference.

See Data Management for more information.

Use the following procedures to manage upgrades to the RAI Native App:

NameDescription
app.schedule_upgrade()Enables automatic engine upgrades or alters the upgrade schedule.
app.unschedule_upgrade()Disables automatic engine upgrades.
app.upgrade_schedule_status()Gets information about the current upgrade schedule.
app.upgrade()Starts upgrading engines to the latest version.
app.upgrade_statusShows engine upgrade status information.
app.upgrade_status_detailsShows detailed engine upgrade status information.
app.upgrade_reasoners()Starts upgrading reasoners to the latest version.
app.upgrade_reasoners_statusShows reasoner upgrade status information.
app.finalize_upgrade()Finalizes an engine upgrade.
api.update_libraries()Updates libraries for a PyRel semantic model.

See Upgrades for details on upgrading the RAI Native App.

Use the following preview views to monitor resource usage for logic reasoners. Views in observability_preview are experimental and may change without notice.

NameDescription
observability_preview.logic_reasoner__cpu_utilizationShows CPU utilization for logic reasoners.
observability_preview.logic_reasoner__memory_utilizationShows memory utilization for logic reasoners.
observability_preview.logic_reasoner__demandShows transaction demand for logic reasoners.

See Observability for more information.

Use the following views to monitor the billing and consumption of your RAI Native App:

NameDescription
consumption.engine_credit_hoursShows credits consumed per engine per hour.

See Cost Management for more information on monitoring and managing your RAI usage costs.