Registering data

This topic describes how to register data so it can be linked into a Snowflake Data Clean Room.

Supported objects

The types of objects that can be linked into a clean room differs depending on whether it is created in the web app or using the developer APIs. Specific objects of these types must be registered before they can be linked.

Web app:

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

  • Tables

  • External tables

  • Apache Iceberg™ tables

  • Dynamic 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.

Note

External tables and Iceberg tables must be explicitly allowed to be linked in a clean room. For more information, see Snowflake Data Clean Rooms: External and Iceberg tables.

Registering data objects

Before users can link data into a Snowflake Data Clean Room, the data must be registered at the database, schema, or object level. If you register 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.

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 Admin » 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 any type of object

library.register_objects

Array of names of any type of object, including databases or schemas.

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_DB.MY_SCHEMA']);
Copy

Unregister data using the developer APIs

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 any type of object

library.unregister_objects

Array of names of any type of object, including databases or schemas.

Language: English