create_schema()#

relationalai.api
create_schema(<schema_name>);

Creates a new RelationalAI (RAI) schema within the RAI Native App for Snowflake. The new schema includes functions and stored procedures for data interaction, as well as a set of application roles to grant user access to the schema. Requires the schema_admin application role.

Parameters#

NameTypeDescription
<schema_name>STRINGThe name of the RAI schema to create (case-sensitive).

Example#

Use create_schema() to create a new RAI schema:

CALL relationalai.api.create_schema('my_rai_schema');

To grant all schema permissions to a user’s database role, use:

GRANT relationalai.my_rai_schema.my_rai_schema_all TO ROLE <database_role_name>;

Refer to RAI Schema Application Roles for a list of available schema roles.

See Also#