Enable resource reference¶
Database objects and procedures¶
The following database objects are created when the file ingestion/resource_management.sql is executed.
PUBLIC.ENABLE_ RESOURCE(resource_ ingestion_ definition_ id VARCHAR)¶
Entry point procedure available to the ADMIN role. This procedure invokes the Java function EnableResourceHandler.enableResource.
PUBLIC.ENABLE_ RESOURCE_ VALIDATE(resource_ ingestion_ definition_ id VARCHAR)¶
Procedure used for connector specific validation of enable process. By default, it returns 'response_code': 'OK'.
It is invoked by DefaultEnableResourceValidator. Can be overwritten both in SQL and Java.
PUBLIC.PRE_ ENABLE_ RESOURCE(resource_ ingestion_ definition_ id VARCHAR)¶
Procedure used for adding connector specific logic which is invoked before a resource is enabled.
By default, it returns 'response_code': 'OK'.
It is invoked by DefaultPreEnableResourceCallback. Can be overwritten both in SQL and Java.
PUBLIC.POST_ ENABLE_ RESOURCE(resource_ ingestion_ definition_ id VARCHAR)¶
Procedure used for adding connector specific logic which is invoked after a resource is enabled.
By default, it returns 'response_code': 'OK'.
It is invoked by DefaultPostEnableResourceCallback. Can be overwritten both in SQL and Java.
Related Java objects¶
The following Java objects from the com.snowflake.connectors.application.ingestion.enable package and some common components are tightly connected with the above procedures:
EnableResourceHandlerEnableResourceHandlerBuilderEnableResourceValidatorPreEnableResourceCallbackPostEnableResourceCallbackConnectorErrorHelper
Custom handler¶
The handler and its internals can be customized using the following approaches.
Procedure replacement approach¶
The following components can be replaced using SQL.
Handler¶
To provide whole custom implementation of EnableResourceHandler, the PUBLIC.ENABLE_RESOURCE procedure must be replaced. For example:
Internal procedures¶
Internal procedures ENABLE_RESOURCE_VALIDATE, PRE_ENABLE_RESOURCE and POST_ENABLE_RESOURCE can be also customized through the SQL. These procedures can also invoke other Java handlers:
Builder approach¶
EnableResourceHandler can be customized using EnableResourceHandlerBuilder. This builder allows user to provide custom implementations of the following interfaces:
EnableResourceValidatorPreEnableResourceCallbackPostEnableResourceCallbackConnectorErrorHelper
In case a function is not provided the default implementation provided by the SDK will be used.