Register data for a Snowflake Data Clean Room¶

Before users can link data into a Snowflake Data Clean Room, the data must be registered at the database, schema, or object level. If the administrator registers a database or schema, all of the objects in that database or schema are registered.

You can register databases, schemas, and objects using Snowsight or the developer APIs. Using Snowsight is simpler, but requires that you have the ACCOUNTADMIN role. With the developer APIs, the owner of an object can register it even if they are not an account administrator.

Registering a database, schema, or object grants access to the SAMOOHA_APP_ROLE role, which is the role that developers use when they execute the developer APIs.

Note

Registering a database or schema does not automatically register objects that are added after the registration. You must either register the new object individually or use the web app’s Snowflake Admin option to return to the Database Registration section, and then select Resync.

Supported objects¶

Keep in mind that only the following objects can linked, even if they are registered:

Web app:

The web app of Snowflake Data Clean Rooms supports the following objects:

  • Tables

  • Views

  • Materialized views

  • Secure views. The owner of a secure view must be the SAMOOHA_APP_ROLE role.

Developer API:

Because Snowflake Data Clean Rooms rely on the Snowflake Native App Framework, you can link any object that is supported by the Snowflake Native App Framework.

Register data in Snowsight¶

To register a database, schema, or object in Snowsight, do the following:

  1. Sign in to the web app.

  2. Select Snowflake Admin.

  3. Select Login to Snowflake, and authenticate as a user with the ACCOUNTADMIN role.

  4. In the Database Registration section, select Edit, and then select the database, schema, or object.

  5. Select Save.

Register data using the developer APIs¶

The developer APIs let account administrators register databases, schemas, and objects programmatically. The owner of the database, schema, or object can register it. The following APIs are available:

Task

API

Input

Register a database

  • provider.register_db (for providers)

  • consumer.register_db (for consumers)

Database name (string)

Register a schema

library.register_schema

Schema names (array of strings)

Register a managed access schema

library.register_managed_access_schema

Managed access schema names (array of strings)

Register a table

library.register_table

Table names (array of strings)

Register a view

library.register_view

View names (array of strings)

For example, the owner of a schema MY_SCHEMA can register it by executing the following commands in a worksheet:

CALL samooha_by_snowflake_local_db.library.register_schema(['MY_SCHEMA']);
Copy

Unregister data¶

You can use the following APIs to reverse the registration of databases, schemas, and objects:

Task

API

Input

Unregister a database

library.unregister_db

Database name (string)

Unregister a schema

library.unregister_schema

Schema names (array of strings)

Unregister a managed access schema

library.unregister_managed_access_schema

Managed access schema names (array of strings)

Unregister a table

library.unregister_table

Table names (array of strings)

Unregister a view

library.unregister_view

View names (array of strings)