diff --git a/docs/snowflake-docs/providers/snowflake/account/accounts/index.md b/docs/snowflake-docs/providers/snowflake/account/accounts/index.md index 3479f2b13..7f4ae5385 100644 --- a/docs/snowflake-docs/providers/snowflake/account/accounts/index.md +++ b/docs/snowflake-docs/providers/snowflake/account/accounts/index.md @@ -1,4 +1,4 @@ ---- +--- title: accounts hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a accounts resource. +Creates, updates, deletes, gets or lists an accounts resource. ## Overview @@ -28,106 +28,361 @@ Creates, updates, deletes, gets or lists a accounts resource.
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | System-assigned identifier of the acccount. | -| | `string` | Legacy Snowflake account URL syntax that includes the region_name and account_locator. | -| | `string` | If the original account URL was saved when the account was renamed, indicates the last time the account was accessed using the original URL. | -| | `string` | If the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved. | -| | `string` | Preferred Snowflake account URL that includes the values of organization_name and account_name. | -| | `string` | Name of the account administrator. | -| | `string` | Password for the account administrator. | -| | `string` | RSA public key for the account administrator. | -| | `string` | User type of the account administrator. | -| | `string` | Optional comment in which to store information related to the account. | -| | `string` | Name of the consumption billing entity. | -| | `string` | Date and time the account was created. | -| | `string` | Date and time the account was dropped. | -| | `string` | Snowflake Edition of the account. | -| | `string` | Email address of the account administrator. | -| | `string` | First name of the account administrator. | -| | `boolean` | Indicates whether an account is an events account. For more information, see Set up logging and event sharing for an application. | -| | `boolean` | Indicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled. | -| | `string` | Last name of the account administrator. | -| | `integer` | Indicates how many managed accounts have been created by the account. | -| | `string` | Name of the marketplace consumer billing entity. | -| | `string` | Name of the marketplace provider billing entity. | -| | `string` | Date and time when the account was moved to a different organization. | -| | `string` | If the account was moved to a different organization, provides the name of that organization. | -| | `boolean` | Indicates whether the account administrator must change the password at the next login. | -| | `string` | If the original account URL was saved when the account was renamed, provides the original URL. If the original account URL was dropped, the value is NULL even if the account was renamed | -| | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL will be dropped. Dropped URLs cannot be used to access the account. | -| | `string` | Name of the organization. | -| | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the original account URL. If the original account URL was dropped, the value is NULL even if the organization changed. | -| | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, indicates the last time the account was accessed using the original account URL. | -| | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL was saved. | -| | `boolean` | Indicates whether the account is a Polaris account. | -| | `string` | Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). | -| | `string` | Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups. | -| | `string` | Date and time when the account was last restored. | -| | `integer` | Number of days that historical data is retained for Time Travel. | -| | `string` | Date and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | , , | Lists the accessible accounts. | -| | `INSERT` | | - | Creates a account. You must provide the full account definition when creating a account. | -| | `DELETE` | | | Deletes the specified account. If you enable the `ifExists` parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful. | -| | `EXEC` | | - | Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period). | +The following fields are returned by `SELECT` queries: + + + + +Snowflake account object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringName of the account administrator.
stringName of the consumption billing entity.
stringFirst name of the account administrator.
stringLast name of the account administrator.
stringName of the marketplace consumer billing entity.
stringName of the marketplace provider billing entity.
stringName of the organization.
stringSystem-assigned identifier of the acccount.
stringLegacy Snowflake account URL syntax that includes the region_name and account_locator.
string (date-time)If the original account URL was saved when the account was renamed, indicates the last time the account was accessed using the original URL.
string (date-time)If the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved.
stringPreferred Snowflake account URL that includes the values of organization_name and account_name.
string (password)Password for the account administrator.
string (password)RSA public key for the account administrator.
stringUser type of the account administrator.
stringOptional comment in which to store information related to the account.
string (date-time)Date and time the account was created.
string (date-time)Date and time the account was dropped.
stringSnowflake Edition of the account.
stringEmail address of the account administrator.
booleanIndicates whether an account is an events account. For more information, see Set up logging and event sharing for an application.
booleanIndicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled.
integer (int64)Indicates how many managed accounts have been created by the account.
string (date-time)Date and time when the account was moved to a different organization.
stringIf the account was moved to a different organization, provides the name of that organization.
booleanIndicates whether the account administrator must change the password at the next login.
stringIf the original account URL was saved when the account was renamed, provides the original URL. If the original account URL was dropped, the value is NULL even if the account was renamed
string (date-time)If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL will be dropped. Dropped URLs cannot be used to access the account.
stringIf the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the original account URL. If the original account URL was dropped, the value is NULL even if the organization changed.
string (date-time)If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, indicates the last time the account was accessed using the original account URL.
string (date-time)If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL was saved.
booleanIndicates whether the account is a Polaris account.
stringSnowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account).
stringRegion group where the account is located. Note - This column is only displayed for organizations that span multiple region groups.
string (date-time)Date and time when the account was last restored.
integerNumber of days that historical data is retained for Time Travel.
string (date-time)Date and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time.
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlike, showLimit, historyLists the accessible accounts.
endpointCreates a account. You must provide the full account definition when creating a account.
name, gracePeriodInDays, endpointifExistsDeletes the specified account. If you enable the `ifExists` parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful.
name, endpointRestores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period).
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Optionally includes dropped accounts that have not yet been purged. | `boolean` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
integerSpecifies the number of days during which the account can be restored (“undropped”). The minimum is 3 days and the maximum is 90 days.
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanOptionally includes dropped accounts that have not yet been purged.
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -Lists the accessible accounts. + + +Lists the accessible accounts. ```sql SELECT name, +admin_name, +consumption_billing_entity_name, +first_name, +last_name, +marketplace_consumer_billing_entity_name, +marketplace_provider_billing_entity_name, +organization_name, account_locator, account_locator_url, account_old_url_last_used, account_old_url_saved_on, account_url, -admin_name, admin_password, admin_rsa_public_key, admin_user_type, comment, -consumption_billing_entity_name, created_on, dropped_on, edition, email, -first_name, is_events_account, is_org_admin, -last_name, managed_accounts, -marketplace_consumer_billing_entity_name, -marketplace_provider_billing_entity_name, moved_on, moved_to_organization, must_change_password, old_account_url, organization_URL_expiration_on, -organization_name, organization_old_url, organization_old_url_last_used, organization_old_url_saved_on, @@ -138,24 +393,29 @@ restored_on, retention_time, scheduled_deletion_time FROM snowflake.account.accounts -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND showLimit = '{{ showLimit }}' +AND history = '{{ history }}'; ``` -## `INSERT` example + + -Creates a account. You must provide the full account definition when creating a account. + +## `INSERT` examples - + { label: 'create_account', value: 'create_account' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Creates a account. You must provide the full account definition when creating a account. ```sql -/*+ create */ INSERT INTO snowflake.account.accounts ( data__name, data__region_group, @@ -192,32 +452,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.account.accounts ( -data__name, -data__admin_name, -data__email, -data__edition, -endpoint -) -SELECT -'{{ name }}', -'{{ admin_name }}', -'{{ email }}', -'{{ edition }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: accounts props: - name: endpoint @@ -225,79 +463,121 @@ SELECT description: Required parameter for the accounts resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the accounts resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: region_group value: string - description: >- - Region group where the account is located. Note - This column is only - displayed for organizations that span multiple region groups. + description: > + Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups. + - name: region value: string - description: >- - Snowflake Region where the account is located. A Snowflake Region is a - distinct location within a cloud platform region that is isolated from - other Snowflake Regions. A Snowflake Region can be either multi-tenant - or single-tenant (for a Virtual Private Snowflake account). + description: > + Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). + - name: edition value: string - description: >- - Snowflake Edition of the account. (valid values: 'STANDARD', - 'ENTERPRISE', 'BUSINESS_CRITICAL') (Required parameter for the accounts - resource.) + description: > + Snowflake Edition of the account. + + valid_values: ['STANDARD', 'ENTERPRISE', 'BUSINESS_CRITICAL'] - name: comment value: string - description: Optional comment in which to store information related to the account. + description: > + Optional comment in which to store information related to the account. + - name: admin_name value: string - description: >- - Name of the account administrator. (Required parameter for the accounts - resource.) + description: > + Name of the account administrator. + - name: admin_password value: string - description: Password for the account administrator. + description: > + Password for the account administrator. + - name: admin_rsa_public_key value: string - description: RSA public key for the account administrator. + description: > + RSA public key for the account administrator. + - name: admin_user_type value: string - description: User type of the account administrator. + description: > + User type of the account administrator. + - name: first_name value: string - description: First name of the account administrator. + description: > + First name of the account administrator. + - name: last_name value: string - description: Last name of the account administrator. + description: > + Last name of the account administrator. + - name: email value: string - description: >- - Email address of the account administrator. (Required parameter for the - accounts resource.) + description: > + Email address of the account administrator. + - name: must_change_password value: boolean - description: >- - Indicates whether the account administrator must change the password at - the next login. + description: > + Indicates whether the account administrator must change the password at the next login. + default: false - name: polaris value: boolean - description: Indicates whether the account is a Polaris account. + description: > + Indicates whether the account is a Polaris account. + default: false ``` -## `DELETE` example + +## `DELETE` examples + + + Deletes the specified account. If you enable the `ifExists` parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful. ```sql -/*+ delete */ DELETE FROM snowflake.account.accounts -WHERE gracePeriodInDays = '{{ gracePeriodInDays }}' -AND name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND gracePeriodInDays = '{{ gracePeriodInDays }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period). + +```sql +EXEC snowflake.account.accounts.undrop_account +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/alert/alerts/index.md b/docs/snowflake-docs/providers/snowflake/alert/alerts/index.md index 59dd0ff7c..bf64dc084 100644 --- a/docs/snowflake-docs/providers/snowflake/alert/alerts/index.md +++ b/docs/snowflake-docs/providers/snowflake/alert/alerts/index.md @@ -1,4 +1,4 @@ ---- +--- title: alerts hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a alerts resource. +Creates, updates, deletes, gets or lists an alerts resource. ## Overview @@ -28,47 +28,303 @@ Creates, updates, deletes, gets or lists a alerts resource.
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the alert | -| | `string` | The SQL statement to execute when the alert is triggered | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | The SQL statement that must be evaluated to determine whether to trigger the alert | -| | `string` | Date and time when the alert was created. | -| | `string` | Database in which the alert is stored | -| | `string` | Role that owns the alert | -| | `string` | The type of role that owns the alert | -| | `object` | | -| | `string` | Schema in which the alert is stored | -| | `string` | The current state of the alert | -| | `string` | The warehouse the alert runs in | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch an alert | -| | `SELECT` | | , , , | List alerts | -| | `INSERT` | | | Create an alert | -| | `DELETE` | | | Delete an alert | -| | `EXEC` | | | Create a new alert by cloning from the specified resource | -| | `EXEC` | | - | Execute an alert | +The following fields are returned by `SELECT` queries: -
+ + +A Snowflake alert -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the alert
stringDatabase in which the alert is stored
stringSchema in which the alert is stored
stringThe SQL statement to execute when the alert is triggered
stringuser comment associated to an object in the dictionary
stringThe SQL statement that must be evaluated to determine whether to trigger the alert
string (date-time)Date and time when the alert was created.
stringRole that owns the alert
stringThe type of role that owns the alert
object
stringThe current state of the alert
stringThe warehouse the alert runs in
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | +A Snowflake alert -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the alert
stringDatabase in which the alert is stored
stringSchema in which the alert is stored
stringThe SQL statement to execute when the alert is triggered
stringuser comment associated to an object in the dictionary
stringThe SQL statement that must be evaluated to determine whether to trigger the alert
string (date-time)Date and time when the alert was created.
stringRole that owns the alert
stringThe type of role that owns the alert
object
stringThe current state of the alert
stringThe warehouse the alert runs in
+
+
+ +## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromNameList alerts
database_name, schema_name, name, endpointFetch an alert
database_name, schema_name, endpointcreateModeCreate an alert
database_name, schema_name, name, endpointifExistsDelete an alert
database_name, schema_name, name, targetDatabase, targetSchema, endpointcreateModeCreate a new alert by cloning from the specified resource
database_name, schema_name, name, endpointExecute an alert
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringDatabase of the newly created resource. Defaults to the source's database
stringSchema of the newly created resource. Defaults to the source's schema
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -77,8 +333,8 @@ Creates, updates, deletes, gets or lists a alerts resource. values={[ { label: 'list_alerts', value: 'list_alerts' }, { label: 'fetch_alert', value: 'fetch_alert' } - ] -}> + ]} +> List alerts @@ -86,21 +342,25 @@ List alerts ```sql SELECT name, +database_name, +schema_name, action, comment, condition, created_on, -database_name, owner, owner_role_type, schedule, -schema_name, state, warehouse FROM snowflake.alert.alerts -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` @@ -110,42 +370,41 @@ Fetch an alert ```sql SELECT name, +database_name, +schema_name, action, comment, condition, created_on, -database_name, owner, owner_role_type, schedule, -schema_name, state, warehouse FROM snowflake.alert.alerts -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create an alert +## `INSERT` examples - + { label: 'create_alert', value: 'create_alert' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create an alert ```sql -/*+ create */ INSERT INTO snowflake.alert.alerts ( data__name, data__comment, @@ -155,7 +414,8 @@ data__condition, data__action, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -166,40 +426,15 @@ SELECT '{{ action }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.alert.alerts ( -data__name, -data__schedule, -data__condition, -data__action, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ schedule }}', -'{{ condition }}', -'{{ action }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: alerts props: - name: database_name @@ -213,40 +448,102 @@ SELECT description: Required parameter for the alerts resource. - name: name value: string - description: Name of the alert (Required parameter for the alerts resource.) + description: > + Name of the alert + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + - name: schedule - value: - schedule_type: string - description: Required parameter for the alerts resource. + value: object - name: warehouse value: string - description: The warehouse the alert runs in + description: > + The warehouse the alert runs in + - name: condition value: string - description: >- - The SQL statement that must be evaluated to determine whether to trigger - the alert (Required parameter for the alerts resource.) + description: > + The SQL statement that must be evaluated to determine whether to trigger the alert + - name: action value: string - description: >- - The SQL statement to execute when the alert is triggered (Required - parameter for the alerts resource.) + description: > + The SQL statement to execute when the alert is triggered + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete an alert ```sql -/*+ delete */ DELETE FROM snowflake.alert.alerts -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + + + +## Lifecycle Methods + + + + +Create a new alert by cloning from the specified resource + +```sql +EXEC snowflake.alert.alerts.clone_alert +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetDatabase='{{ targetDatabase }}' --required, +@targetSchema='{{ targetSchema }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}' +@@json= +'{ +"name": "{{ name }}", +"point_of_time": "{{ point_of_time }}" +}'; +``` + + + +Execute an alert + +```sql +EXEC snowflake.alert.alerts.execute_alert +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/api_integration/api_integrations/index.md b/docs/snowflake-docs/providers/snowflake/api_integration/api_integrations/index.md index 7cff0483f..ddac0bde7 100644 --- a/docs/snowflake-docs/providers/snowflake/api_integration/api_integrations/index.md +++ b/docs/snowflake-docs/providers/snowflake/api_integration/api_integrations/index.md @@ -1,4 +1,4 @@ ---- +--- title: api_integrations hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a api_integrations resource. +Creates, updates, deletes, gets or lists an api_integrations resource. ## Overview @@ -28,38 +28,211 @@ Creates, updates, deletes, gets or lists a api_integrations resourc
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the API integration. | -| | `array` | A comma-separated list of endpoints and resources that Snowflake can access. | -| | `array` | A comma-separated list of endpoints and resources that are not allowed to be called from Snowflake. | -| | `object` | | -| | `string` | Comment for the API integration. | -| | `string` | Date and time when the API integration was created. | -| | `boolean` | Whether the API integration is enabled. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch an API integration | -| | `SELECT` | | | List API integrations | -| | `INSERT` | | | Create an API integration | -| | `DELETE` | | | Delete an API integration | -| | `REPLACE` | | - | Create an (or alter an existing) API integration. Note that API_KEY is not currently altered by this operation and is supported for a newly-created object only. Unsetting API_BLOCKED_PREFIXES is also unsupported. | +The following fields are returned by `SELECT` queries: + + + -
+A Snowflake API integration object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the API integration. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayA comma-separated list of endpoints and resources that Snowflake can access.
arrayA comma-separated list of endpoints and resources that are not allowed to be called from Snowflake.
object
stringComment for the API integration.
string (date-time)Date and time when the API integration was created.
booleanWhether the API integration is enabled.
+
+ -
-Optional Parameter Details +A Snowflake API integration object. -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the API integration. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayA comma-separated list of endpoints and resources that Snowflake can access.
arrayA comma-separated list of endpoints and resources that are not allowed to be called from Snowflake.
object
stringComment for the API integration.
string (date-time)Date and time when the API integration was created.
booleanWhether the API integration is enabled.
+ + -
+## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlikeList API integrations
name, endpointFetch an API integration
endpointcreateModeCreate an API integration
name, endpointCreate an (or alter an existing) API integration. Note that API_KEY is not currently altered by this operation and is supported for a newly-created object only. Unsetting API_BLOCKED_PREFIXES is also unsupported.
name, endpointifExistsDelete an API integration
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -68,8 +241,8 @@ Creates, updates, deletes, gets or lists a api_integrations resourc values={[ { label: 'list_api_integrations', value: 'list_api_integrations' }, { label: 'fetch_api_integration', value: 'fetch_api_integration' } - ] -}> + ]} +> List API integrations @@ -84,7 +257,8 @@ comment, created_on, enabled FROM snowflake.api_integration.api_integrations -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -101,28 +275,27 @@ comment, created_on, enabled FROM snowflake.api_integration.api_integrations -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create an API integration +## `INSERT` examples - + { label: 'create_api_integration', value: 'create_api_integration' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create an API integration ```sql -/*+ create */ INSERT INTO snowflake.api_integration.api_integrations ( data__name, data__api_hook, @@ -130,7 +303,8 @@ data__api_allowed_prefixes, data__api_blocked_prefixes, data__enabled, data__comment, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -139,36 +313,15 @@ SELECT '{{ api_blocked_prefixes }}', {{ enabled }}, '{{ comment }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.api_integration.api_integrations ( -data__name, -data__api_hook, -data__api_allowed_prefixes, -data__enabled, -endpoint -) -SELECT -'{{ name }}', -'{{ api_hook }}', -'{{ api_allowed_prefixes }}', -{{ enabled }}, -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: api_integrations props: - name: endpoint @@ -176,65 +329,89 @@ SELECT description: Required parameter for the api_integrations resource. - name: name value: string - description: >- - Name of the API integration. (Required parameter for the - api_integrations resource.) + description: > + Name of the API integration. + - name: api_hook - value: - type: string - description: Required parameter for the api_integrations resource. + value: object - name: api_allowed_prefixes value: array - description: >- - A comma-separated list of endpoints and resources that Snowflake can - access. (Required parameter for the api_integrations resource.) + description: > + A comma-separated list of endpoints and resources that Snowflake can access. + - name: api_blocked_prefixes value: array - description: >- - A comma-separated list of endpoints and resources that are not allowed - to be called from Snowflake. + description: > + A comma-separated list of endpoints and resources that are not allowed to be called from Snowflake. + - name: enabled value: boolean - description: >- - Whether the API integration is enabled. (Required parameter for the - api_integrations resource.) + description: > + Whether the API integration is enabled. + - name: comment value: string - description: Comment for the API integration. + description: > + Comment for the API integration. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `REPLACE` example + +## `REPLACE` examples + + + Create an (or alter an existing) API integration. Note that API_KEY is not currently altered by this operation and is supported for a newly-created object only. Unsetting API_BLOCKED_PREFIXES is also unsupported. ```sql -/*+ update */ REPLACE snowflake.api_integration.api_integrations SET -name = '{{ name }}', -api_hook = '{{ api_hook }}', -api_allowed_prefixes = '{{ api_allowed_prefixes }}', -api_blocked_prefixes = '{{ api_blocked_prefixes }}', -enabled = {{ enabled }}, -comment = '{{ comment }}' +data__name = '{{ name }}', +data__api_hook = '{{ api_hook }}', +data__api_allowed_prefixes = '{{ api_allowed_prefixes }}', +data__api_blocked_prefixes = '{{ api_blocked_prefixes }}', +data__enabled = {{ enabled }}, +data__comment = '{{ comment }}' WHERE -name = '{{ name }}' -AND data__api_allowed_prefixes = '{{ data__api_allowed_prefixes }}' -AND data__api_hook = '{{ data__api_hook }}' -AND data__enabled = '{{ data__enabled }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required +AND data__api_hook = '{{ api_hook }}' --required +AND data__api_allowed_prefixes = '{{ api_allowed_prefixes }}' --required +AND data__enabled = {{ enabled }} --required; ``` + + -## `DELETE` example + +## `DELETE` examples + + + Delete an API integration ```sql -/*+ delete */ DELETE FROM snowflake.api_integration.api_integrations -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/catalog_integration/catalog_integrations/index.md b/docs/snowflake-docs/providers/snowflake/catalog_integration/catalog_integrations/index.md index 87718a15e..934dc92be 100644 --- a/docs/snowflake-docs/providers/snowflake/catalog_integration/catalog_integrations/index.md +++ b/docs/snowflake-docs/providers/snowflake/catalog_integration/catalog_integrations/index.md @@ -1,4 +1,4 @@ ---- +--- title: catalog_integrations hide_title: false hide_table_of_contents: false @@ -28,38 +28,214 @@ Creates, updates, deletes, gets or lists a catalog_integrations res ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the catalog integration. | -| | `object` | | -| | `string` | Category of the integration. Always CATALOG. | -| | `string` | Comment. | -| | `string` | Date and time when the catalog integration was created. | -| | `boolean` | whether this catalog integration is available to use for Iceberg tables. | -| | `string` | Table format of the catalog. | -| | `string` | Type of the integration. Always CATALOG. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a catalog integration. | -| | `SELECT` | | | List catalog integrations. | -| | `INSERT` | | | Create a catalog integration. | -| | `DELETE` | | | Delete a catalog integration. | +The following fields are returned by `SELECT` queries: + + + + +Catalog integration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the catalog integration. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
object
stringCategory of the integration. Always CATALOG.
stringComment.
string (date-time)Date and time when the catalog integration was created.
booleanwhether this catalog integration is available to use for Iceberg tables.
stringTable format of the catalog.
stringType of the integration. Always CATALOG.
+
+ + +Catalog integration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the catalog integration. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
object
stringCategory of the integration. Always CATALOG.
stringComment.
string (date-time)Date and time when the catalog integration was created.
booleanwhether this catalog integration is available to use for Iceberg tables.
stringTable format of the catalog.
stringType of the integration. Always CATALOG.
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlikeList catalog integrations.
name, endpointFetch a catalog integration.
endpointcreateModeCreate a catalog integration.
name, endpointifExistsDelete a catalog integration.
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -68,8 +244,8 @@ Creates, updates, deletes, gets or lists a catalog_integrations res values={[ { label: 'list_catalog_integrations', value: 'list_catalog_integrations' }, { label: 'fetch_catalog_integration', value: 'fetch_catalog_integration' } - ] -}> + ]} +> List catalog integrations. @@ -85,7 +261,8 @@ enabled, table_format, type FROM snowflake.catalog_integration.catalog_integrations -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -103,35 +280,35 @@ enabled, table_format, type FROM snowflake.catalog_integration.catalog_integrations -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a catalog integration. +## `INSERT` examples - + { label: 'create_catalog_integration', value: 'create_catalog_integration' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a catalog integration. ```sql -/*+ create */ INSERT INTO snowflake.catalog_integration.catalog_integrations ( data__name, data__catalog, data__table_format, data__enabled, data__comment, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -139,36 +316,15 @@ SELECT '{{ table_format }}', {{ enabled }}, '{{ comment }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.catalog_integration.catalog_integrations ( -data__name, -data__catalog, -data__table_format, -data__enabled, -endpoint -) -SELECT -'{{ name }}', -'{{ catalog }}', -'{{ table_format }}', -{{ enabled }}, -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: catalog_integrations props: - name: endpoint @@ -176,37 +332,52 @@ SELECT description: Required parameter for the catalog_integrations resource. - name: name value: string - description: >- - Name of the catalog integration. (Required parameter for the - catalog_integrations resource.) + description: > + Name of the catalog integration. + - name: catalog - value: - catalog_source: string - description: Required parameter for the catalog_integrations resource. + value: object - name: table_format value: string - description: >- - Table format of the catalog. (valid values: 'ICEBERG') (Required - parameter for the catalog_integrations resource.) + description: > + Table format of the catalog. + + valid_values: ['ICEBERG'] - name: enabled value: boolean - description: >- - whether this catalog integration is available to use for Iceberg tables. - (Required parameter for the catalog_integrations resource.) + description: > + whether this catalog integration is available to use for Iceberg tables. + - name: comment value: string - description: Comment. + description: > + Comment. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a catalog integration. ```sql -/*+ delete */ DELETE FROM snowflake.catalog_integration.catalog_integrations -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/compute_pool/compute_pools/index.md b/docs/snowflake-docs/providers/snowflake/compute_pool/compute_pools/index.md index c251d51a7..f4856b422 100644 --- a/docs/snowflake-docs/providers/snowflake/compute_pool/compute_pools/index.md +++ b/docs/snowflake-docs/providers/snowflake/compute_pool/compute_pools/index.md @@ -1,4 +1,4 @@ ---- +--- title: compute_pools hide_title: false hide_table_of_contents: false @@ -28,60 +28,404 @@ Creates, updates, deletes, gets or lists a compute_pools resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `integer` | Number of currently active nodes on the compute pool. | -| | `string` | Name of the Snowflake Native App if the compute pool is created exclusively for the app. | -| | `boolean` | Whether Snowflake automatically resumes the compute pool when any statement that requires the compute pool is submitted. | -| | `integer` | Number of seconds until the compute pool automatically suspends. | -| | `string` | The name of the budget monitoring the credit usage of the compute pool. | -| | `string` | Comment describing the compute pool. | -| | `string` | Time the compute pool was created. | -| | `string` | Current error the compute pool hit if any. | -| | `integer` | Number of currently idle nodes on the compute pool. | -| | `string` | Instance family for the compute pool. | -| | `boolean` | Whether a compute pool is created exclusively for a Snowflake Native App. | -| | `integer` | Maximum number of nodes for the compute pool. | -| | `integer` | Minimum number of nodes for the compute pool. | -| | `integer` | Number of jobs on the compute pool. | -| | `integer` | Number of services on the compute pool. | -| | `string` | Identifier for the current owner of the compute pool. | -| | `string` | Time the compute pool was last resumed. | -| | `string` | Current state of the compute pool. Possible values include UNKNOWN, STARTING, IDLE, ACTIVE, STOPPING, SUSPENDED, and RESIZING. | -| | `string` | Current status of the compute pool if any. | -| | `integer` | Number of target nodes on the compute pool. | -| | `string` | Time the compute pool was last updated. | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake compute pool definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
integerNumber of currently active nodes on the compute pool.
stringName of the Snowflake Native App if the compute pool is created exclusively for the app.
booleanWhether Snowflake automatically resumes the compute pool when any statement that requires the compute pool is submitted.
integer (int64)Number of seconds until the compute pool automatically suspends.
stringThe name of the budget monitoring the credit usage of the compute pool.
stringComment describing the compute pool.
string (date-time)Time the compute pool was created.
stringCurrent error the compute pool hit if any.
integerNumber of currently idle nodes on the compute pool.
stringInstance family for the compute pool.
booleanWhether a compute pool is created exclusively for a Snowflake Native App.
integerMaximum number of nodes for the compute pool.
integerMinimum number of nodes for the compute pool.
integerNumber of jobs on the compute pool.
integerNumber of services on the compute pool.
stringIdentifier for the current owner of the compute pool.
string (date-time)Time the compute pool was last resumed.
stringCurrent state of the compute pool. Possible values include UNKNOWN, STARTING, IDLE, ACTIVE, STOPPING, SUSPENDED, and RESIZING.
stringCurrent status of the compute pool if any.
integerNumber of target nodes on the compute pool.
string (date-time)Time the compute pool was last updated.
+
+ + +A Snowflake compute pool definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
integerNumber of currently active nodes on the compute pool.
stringName of the Snowflake Native App if the compute pool is created exclusively for the app.
booleanWhether Snowflake automatically resumes the compute pool when any statement that requires the compute pool is submitted.
integer (int64)Number of seconds until the compute pool automatically suspends.
stringThe name of the budget monitoring the credit usage of the compute pool.
stringComment describing the compute pool.
string (date-time)Time the compute pool was created.
stringCurrent error the compute pool hit if any.
integerNumber of currently idle nodes on the compute pool.
stringInstance family for the compute pool.
booleanWhether a compute pool is created exclusively for a Snowflake Native App.
integerMaximum number of nodes for the compute pool.
integerMinimum number of nodes for the compute pool.
integerNumber of jobs on the compute pool.
integerNumber of services on the compute pool.
stringIdentifier for the current owner of the compute pool.
string (date-time)Time the compute pool was last resumed.
stringCurrent state of the compute pool. Possible values include UNKNOWN, STARTING, IDLE, ACTIVE, STOPPING, SUSPENDED, and RESIZING.
stringCurrent status of the compute pool if any.
integerNumber of target nodes on the compute pool.
string (date-time)Time the compute pool was last updated.
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetches a named compute pool. You can get the name of the compute pool from the `/api/v2/compute-pools` GET request. | -| | `SELECT` | | , , | Lists the compute pools under the account. | -| | `INSERT` | | , | Creates a compute pool, with standard create modifiers as query parameters. See the Compute Pool component definition for what is required to be provided in the request body. | -| | `DELETE` | | | Deletes a compute pool with the given name. If you enable the `ifExists` parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist. | -| | `REPLACE` | | - | Create a (or alter an existing) compute pool. Even if the operation is just an alter, the full property set must be provided. | -| | `EXEC` | | - | Resume a compute pool, if suspended. If the specified compute pool is already running, no action is taken. | -| | `EXEC` | | - | Stops all services in the compute pool. | -| | `EXEC` | | - | Stops all services in the compute pool. Deprecated - use :stop-all-services instead. | -| | `EXEC` | | - | Suspend a compute pool, if active. If the specified compute pool is already suspended, no action is taken. | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Specifies whether the compute pool is created initially in the suspended state. | `boolean` | `-` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlike, startsWith, showLimitLists the compute pools under the account.
name, endpointFetches a named compute pool. You can get the name of the compute pool from the `/api/v2/compute-pools` GET request.
endpointcreateMode, initiallySuspendedCreates a compute pool, with standard create modifiers as query parameters. See the Compute Pool component definition for what is required to be provided in the request body.
name, endpointCreate a (or alter an existing) compute pool. Even if the operation is just an alter, the full property set must be provided.
name, endpointifExistsDeletes a compute pool with the given name. If you enable the `ifExists` parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist.
name, endpointResume a compute pool, if suspended. If the specified compute pool is already running, no action is taken.
name, endpointSuspend a compute pool, if active. If the specified compute pool is already suspended, no action is taken.
name, endpointStops all services in the compute pool. Deprecated - use :stop-all-services instead.
name, endpointStops all services in the compute pool.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
booleanSpecifies whether the compute pool is created initially in the suspended state.
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -90,8 +434,8 @@ Creates, updates, deletes, gets or lists a compute_pools resource. values={[ { label: 'list_compute_pools', value: 'list_compute_pools' }, { label: 'fetch_compute_pool', value: 'fetch_compute_pool' } - ] -}> + ]} +> Lists the compute pools under the account. @@ -121,7 +465,10 @@ status_message, target_nodes, updated_on FROM snowflake.compute_pool.compute_pools -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}'; ``` @@ -153,28 +500,27 @@ status_message, target_nodes, updated_on FROM snowflake.compute_pool.compute_pools -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Creates a compute pool, with standard create modifiers as query parameters. See the Compute Pool component definition for what is required to be provided in the request body. +## `INSERT` examples - + { label: 'create_compute_pool', value: 'create_compute_pool' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Creates a compute pool, with standard create modifiers as query parameters. See the Compute Pool component definition for what is required to be provided in the request body. ```sql -/*+ create */ INSERT INTO snowflake.compute_pool.compute_pools ( data__name, data__min_nodes, @@ -183,7 +529,9 @@ data__instance_family, data__auto_resume, data__comment, data__auto_suspend_secs, -endpoint +endpoint, +createMode, +initiallySuspended ) SELECT '{{ name }}', @@ -193,36 +541,16 @@ SELECT {{ auto_resume }}, '{{ comment }}', {{ auto_suspend_secs }}, -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ initiallySuspended }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.compute_pool.compute_pools ( -data__name, -data__instance_family, -data__min_nodes, -data__max_nodes, -endpoint -) -SELECT -'{{ name }}', -'{{ instance_family }}', -{{ min_nodes }}, -{{ max_nodes }}, -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: compute_pools props: - name: endpoint @@ -230,72 +558,155 @@ SELECT description: Required parameter for the compute_pools resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the compute_pools resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: min_nodes value: integer - description: >- - Minimum number of nodes for the compute pool. (Required parameter for - the compute_pools resource.) + description: > + Minimum number of nodes for the compute pool. + - name: max_nodes value: integer - description: >- - Maximum number of nodes for the compute pool. (Required parameter for - the compute_pools resource.) + description: > + Maximum number of nodes for the compute pool. + - name: instance_family value: string - description: >- - Instance family for the compute pool. (Required parameter for the - compute_pools resource.) + description: > + Instance family for the compute pool. + - name: auto_resume value: boolean - description: >- - Whether Snowflake automatically resumes the compute pool when any - statement that requires the compute pool is submitted. + description: > + Whether Snowflake automatically resumes the compute pool when any statement that requires the compute pool is submitted. + - name: comment value: string - description: Comment describing the compute pool. + description: > + Comment describing the compute pool. + - name: auto_suspend_secs value: integer - description: Number of seconds until the compute pool automatically suspends. + description: > + Number of seconds until the compute pool automatically suspends. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: initiallySuspended + value: boolean + description: Specifies whether the compute pool is created initially in the suspended state. ``` -## `REPLACE` example + +## `REPLACE` examples + + + Create a (or alter an existing) compute pool. Even if the operation is just an alter, the full property set must be provided. ```sql -/*+ update */ REPLACE snowflake.compute_pool.compute_pools SET -name = '{{ name }}', -min_nodes = {{ min_nodes }}, -max_nodes = {{ max_nodes }}, -instance_family = '{{ instance_family }}', -auto_resume = {{ auto_resume }}, -comment = '{{ comment }}', -auto_suspend_secs = {{ auto_suspend_secs }} +data__name = '{{ name }}', +data__min_nodes = {{ min_nodes }}, +data__max_nodes = {{ max_nodes }}, +data__instance_family = '{{ instance_family }}', +data__auto_resume = {{ auto_resume }}, +data__comment = '{{ comment }}', +data__auto_suspend_secs = {{ auto_suspend_secs }} WHERE -name = '{{ name }}' -AND data__instance_family = '{{ data__instance_family }}' -AND data__max_nodes = '{{ data__max_nodes }}' -AND data__min_nodes = '{{ data__min_nodes }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required +AND data__instance_family = '{{ instance_family }}' --required +AND data__min_nodes = '{{ min_nodes }}' --required +AND data__max_nodes = '{{ max_nodes }}' --required; ``` + + -## `DELETE` example + +## `DELETE` examples + + + Deletes a compute pool with the given name. If you enable the `ifExists` parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist. ```sql -/*+ delete */ DELETE FROM snowflake.compute_pool.compute_pools -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + + + +## Lifecycle Methods + + + + +Resume a compute pool, if suspended. If the specified compute pool is already running, no action is taken. + +```sql +EXEC snowflake.compute_pool.compute_pools.resume_compute_pool +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Suspend a compute pool, if active. If the specified compute pool is already suspended, no action is taken. + +```sql +EXEC snowflake.compute_pool.compute_pools.suspend_compute_pool +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Stops all services in the compute pool. Deprecated - use :stop-all-services instead. + +```sql +EXEC snowflake.compute_pool.compute_pools.stop_all_services_in_compute_pool_deprecated +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Stops all services in the compute pool. + +```sql +EXEC snowflake.compute_pool.compute_pools.stop_all_services_in_compute_pool +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/database/databases/index.md b/docs/snowflake-docs/providers/snowflake/database/databases/index.md index 0abccaa69..a8527acf7 100644 --- a/docs/snowflake-docs/providers/snowflake/database/databases/index.md +++ b/docs/snowflake-docs/providers/snowflake/database/databases/index.md @@ -1,4 +1,4 @@ ---- +--- title: databases hide_title: false hide_table_of_contents: false @@ -28,72 +28,482 @@ Creates, updates, deletes, gets or lists a databases resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Budget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects. | -| | `string` | Optional comment in which to store information related to the database. | -| | `string` | Date and time the database was created. | -| | `integer` | Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the database, as well as specifying the default Time Travel retention time for all schemas created in the database. | -| | `string` | Default collation specification for all schemas and tables added to the database. You an override the default at the schema and individual table levels. | -| | `string` | Date and time the database was dropped. | -| | `boolean` | Current database for the session. | -| | `boolean` | Whether the database is the default database for a user. | -| | `string` | Database type, permanent (default) or transient. | -| | `string` | Severity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. | -| | `integer` | Maximum number of days for which Snowflake can extend the data retention period for tables in the database to prevent streams on the tables from becoming stale. | -| | `string` | | -| | `string` | | -| | `string` | Name of the role that owns the database. | -| | `string` | Type of role that owns the object, either ROLE or DATABASE_ROLE | -| | `integer` | Number of days that historical data is retained for Time Travel. | -| | `string` | Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. | -| | `string` | Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. | -| | `integer` | Maximum number of consecutive failed task runs before the current task is suspended automatically. | -| | `string` | How trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`. | -| | `string` | Size of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size. | -| | `integer` | Time limit, in milliseconds, for a single run of the task before it times out. | + +The following fields are returned by `SELECT` queries: + + + + +Snowflake database object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringBudget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects.
stringOptional comment in which to store information related to the database.
string (date-time)Date and time the database was created.
integerSpecifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the database, as well as specifying the default Time Travel retention time for all schemas created in the database.
stringDefault collation specification for all schemas and tables added to the database. You an override the default at the schema and individual table levels.
string (date-time)Date and time the database was dropped.
booleanCurrent database for the session.
booleanWhether the database is the default database for a user.
stringDatabase type, permanent (default) or transient. (default: PERMANENT)
stringSeverity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`.
integerMaximum number of days for which Snowflake can extend the data retention period for tables in the database to prevent streams on the tables from becoming stale.
string
string
stringName of the role that owns the database.
stringType of role that owns the object, either ROLE or DATABASE_ROLE
integerNumber of days that historical data is retained for Time Travel.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
integerMaximum number of consecutive failed task runs before the current task is suspended automatically.
stringHow trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`.
stringSize of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size.
integerTime limit, in milliseconds, for a single run of the task before it times out.
+
+ + +Snowflake database object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringBudget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects.
stringOptional comment in which to store information related to the database.
string (date-time)Date and time the database was created.
integerSpecifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the database, as well as specifying the default Time Travel retention time for all schemas created in the database.
stringDefault collation specification for all schemas and tables added to the database. You an override the default at the schema and individual table levels.
string (date-time)Date and time the database was dropped.
booleanCurrent database for the session.
booleanWhether the database is the default database for a user.
stringDatabase type, permanent (default) or transient. (default: PERMANENT)
stringSeverity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`.
integerMaximum number of days for which Snowflake can extend the data retention period for tables in the database to prevent streams on the tables from becoming stale.
string
string
stringName of the role that owns the database.
stringType of role that owns the object, either ROLE or DATABASE_ROLE
integerNumber of days that historical data is retained for Time Travel.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
integerMaximum number of consecutive failed task runs before the current task is suspended automatically.
stringHow trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`.
stringSize of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size.
integerTime limit, in milliseconds, for a single run of the task before it times out.
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetches a database. | -| | `SELECT` | | , , , , | Lists the accessible databases. | -| | `INSERT` | | , | Creates a database, with modifiers as query parameters. You must provide the full database definition when creating a database. | -| | `DELETE` | | , | Deletes the specified database. If you enable the `ifExists` parameter, the operation succeeds even if the database does not exist. Otherwise, a 404 failure is returned if the database does not exist. if the drop is unsuccessful. | -| | `REPLACE` | | - | Creates a new, or alters an existing, database. You must provide the full database definition even when altering an existing database. | -| | `EXEC` | | , | Clones an existing database, with modifiers as query parameters. You must provide the full database definition when cloning an existing database. | -| | `EXEC` | | , | Creates a database from a given share. | -| | `EXEC` | | , | Creates a database from a given share. | -| | `EXEC` | | - | Disables failover for this primary database, meaning no replica of this database (i.e. secondary database) can be promoted to serve as the primary database. | -| | `EXEC` | | - | Disables replication for this primary database, meaning no replica of this database (i.e. secondary database) in another account can be refreshed. Any secondary databases remain linked to the primary database, but requests to refresh a secondary database are denied. | -| | `EXEC` | | - | Specifies a comma-separated list of accounts in your organization where a replica of this primary database can be promoted to serve as the primary database. | -| | `EXEC` | | | Promotes a local database to serve as a primary database for replication. A primary database can be replicated in one or more accounts, allowing users in those accounts to query objects in each secondary (i.e. replica) database. | -| | `EXEC` | | - | Promotes the specified secondary (replica) database to serve as the primary database. When promoted, the database becomes writeable. At the same time, the previous primary database becomes a read-only secondary database. | -| | `EXEC` | | - | Refreshes a secondary database from a snapshot of its primary database. A snapshot includes changes to the objects and data. If you call this endpoint while another refresh for the same replica database is running, it fails and returns an error. Snowflake ensures only one refresh is executed at any given time. | -| | `EXEC` | | - | Undrops database. | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Optionally includes dropped databases that have not yet been purged. | `boolean` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Whether to allow replicating data to accounts on lower editions. Default: `true`. For more information, see the {a href=https://docs.snowflake.com/en/sql-reference/sql/alter-database} ALTER DATABASE{/a} reference. | `boolean` | `-` | -| | Type of database to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). | `string` | `-` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Whether to drop the database if foreign keys exist that reference any tables in the database. - `true`: Return a warning about existing foreign key references and don't drop the database. - `false`: Drop the database and all objects in the database, including tables with primary or unique keys that are referenced by foreign keys in other tables. | `boolean` | `false` | -| | ID of the share from which to create the database, in the form "{provider_account}.{share_name}". | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlike, startsWith, showLimit, fromName, historyLists the accessible databases.
name, endpointFetches a database.
endpointcreateMode, kindCreates a database, with modifiers as query parameters. You must provide the full database definition when creating a database.
name, endpointCreates a new, or alters an existing, database. You must provide the full database definition even when altering an existing database.
name, endpointifExists, restrictDeletes the specified database. If you enable the `ifExists` parameter, the operation succeeds even if the database does not exist. Otherwise, a 404 failure is returned if the database does not exist. if the drop is unsuccessful.
endpointcreateMode, shareCreates a database from a given share.
name, endpointcreateMode, shareCreates a database from a given share.
name, endpointcreateMode, kindClones an existing database, with modifiers as query parameters. You must provide the full database definition when cloning an existing database.
name, endpointUndrops database.
name, endpointignore_edition_checkPromotes a local database to serve as a primary database for replication. A primary database can be replicated in one or more accounts, allowing users in those accounts to query objects in each secondary (i.e. replica) database.
name, endpointDisables replication for this primary database, meaning no replica of this database (i.e. secondary database) in another account can be refreshed. Any secondary databases remain linked to the primary database, but requests to refresh a secondary database are denied.
name, endpointRefreshes a secondary database from a snapshot of its primary database. A snapshot includes changes to the objects and data. +If you call this endpoint while another refresh for the same replica database is running, it fails and returns an error. Snowflake ensures only one refresh is executed at any given time.
name, endpointSpecifies a comma-separated list of accounts in your organization where a replica of this primary database can be promoted to serve as the primary database.
name, endpointDisables failover for this primary database, meaning no replica of this database (i.e. secondary database) can be promoted to serve as the primary database.
name, endpointPromotes the specified secondary (replica) database to serve as the primary database. When promoted, the database becomes writeable. At the same time, the previous primary database becomes a read-only secondary database.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanOptionally includes dropped databases that have not yet been purged.
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
booleanWhether to allow replicating data to accounts on lower editions. Default: `true`. For more information, see the ALTER DATABASE reference.
stringType of database to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string).
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
booleanWhether to drop the database if foreign keys exist that reference any tables in the database. - `true`: Return a warning about existing foreign key references and don't drop the database. - `false`: Drop the database and all objects in the database, including tables with primary or unique keys that are referenced by foreign keys in other tables. (default: false)
stringID of the share from which to create the database, in the form ".".
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -102,8 +512,8 @@ Creates, updates, deletes, gets or lists a databases resource. values={[ { label: 'list_databases', value: 'list_databases' }, { label: 'fetch_database', value: 'fetch_database' } - ] -}> + ]} +> Lists the accessible databases. @@ -134,7 +544,12 @@ trace_level, user_task_managed_initial_warehouse_size, user_task_timeout_ms FROM snowflake.database.databases -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}' +AND history = '{{ history }}'; ``` @@ -167,28 +582,27 @@ trace_level, user_task_managed_initial_warehouse_size, user_task_timeout_ms FROM snowflake.database.databases -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Creates a database, with modifiers as query parameters. You must provide the full database definition when creating a database. +## `INSERT` examples - + { label: 'create_database', value: 'create_database' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Creates a database, with modifiers as query parameters. You must provide the full database definition when creating a database. ```sql -/*+ create */ INSERT INTO snowflake.database.databases ( data__name, data__kind, @@ -203,7 +617,9 @@ data__user_task_managed_initial_warehouse_size, data__serverless_task_min_statement_size, data__serverless_task_max_statement_size, data__user_task_timeout_ms, -endpoint +endpoint, +createMode, +kind ) SELECT '{{ name }}', @@ -219,30 +635,16 @@ SELECT '{{ serverless_task_min_statement_size }}', '{{ serverless_task_max_statement_size }}', {{ user_task_timeout_ms }}, -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.database.databases ( -data__name, -endpoint -) -SELECT -'{{ name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ kind }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: databases props: - name: endpoint @@ -250,114 +652,300 @@ SELECT description: Required parameter for the databases resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the databases resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: kind value: string - description: >- - Database type, permanent (default) or transient. (valid values: - 'PERMANENT', 'TRANSIENT') + description: > + Database type, permanent (default) or transient. + + valid_values: ['PERMANENT', 'TRANSIENT'] default: PERMANENT - name: comment value: string - description: Optional comment in which to store information related to the database. + description: > + Optional comment in which to store information related to the database. + - name: data_retention_time_in_days value: integer - description: >- - Specifies the number of days for which Time Travel actions (CLONE and - UNDROP) can be performed on the database, as well as specifying the - default Time Travel retention time for all schemas created in the - database. + description: > + Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the database, as well as specifying the default Time Travel retention time for all schemas created in the database. + - name: default_ddl_collation value: string - description: >- - Default collation specification for all schemas and tables added to the - database. You an override the default at the schema and individual table - levels. + description: > + Default collation specification for all schemas and tables added to the database. You an override the default at the schema and individual table levels. + - name: log_level value: string - description: >- - Severity level of messages that should be ingested and made available in - the active event table. Currently, Snowflake supports only `TRACE`, - `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. + description: > + Severity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. + - name: max_data_extension_time_in_days value: integer - description: >- - Maximum number of days for which Snowflake can extend the data retention - period for tables in the database to prevent streams on the tables from - becoming stale. + description: > + Maximum number of days for which Snowflake can extend the data retention period for tables in the database to prevent streams on the tables from becoming stale. + - name: suspend_task_after_num_failures value: integer - description: >- - Maximum number of consecutive failed task runs before the current task - is suspended automatically. + description: > + Maximum number of consecutive failed task runs before the current task is suspended automatically. + - name: trace_level value: string - description: >- - How trace events are ingested into the event table. Currently, Snowflake - supports only `ALWAYS`, `ON_EVENT`, and `OFF`. + description: > + How trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`. + - name: user_task_managed_initial_warehouse_size value: string - description: >- - Size of the compute resources to provision for the first run of the - serverless task, before a task history is available for Snowflake to - determine an ideal size. + description: > + Size of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size. + - name: serverless_task_min_statement_size value: string - description: >- - Specifies the minimum allowed warehouse size for the serverless task. - Minimum XSMALL, Maximum XXLARGE. + description: > + Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. + - name: serverless_task_max_statement_size value: string - description: >- - Specifies the maximum allowed warehouse size for the serverless task. - Minimum XSMALL, Maximum XXLARGE. + description: > + Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. + - name: user_task_timeout_ms value: integer - description: >- - Time limit, in milliseconds, for a single run of the task before it - times out. + description: > + Time limit, in milliseconds, for a single run of the task before it times out. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: kind + value: string + description: Type of database to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). ``` -## `REPLACE` example + +## `REPLACE` examples + + + Creates a new, or alters an existing, database. You must provide the full database definition even when altering an existing database. ```sql -/*+ update */ REPLACE snowflake.database.databases SET -name = '{{ name }}', -kind = '{{ kind }}', -comment = '{{ comment }}', -data_retention_time_in_days = {{ data_retention_time_in_days }}, -default_ddl_collation = '{{ default_ddl_collation }}', -log_level = '{{ log_level }}', -max_data_extension_time_in_days = {{ max_data_extension_time_in_days }}, -suspend_task_after_num_failures = {{ suspend_task_after_num_failures }}, -trace_level = '{{ trace_level }}', -user_task_managed_initial_warehouse_size = '{{ user_task_managed_initial_warehouse_size }}', -serverless_task_min_statement_size = '{{ serverless_task_min_statement_size }}', -serverless_task_max_statement_size = '{{ serverless_task_max_statement_size }}', -user_task_timeout_ms = {{ user_task_timeout_ms }} +data__name = '{{ name }}', +data__kind = '{{ kind }}', +data__comment = '{{ comment }}', +data__data_retention_time_in_days = {{ data_retention_time_in_days }}, +data__default_ddl_collation = '{{ default_ddl_collation }}', +data__log_level = '{{ log_level }}', +data__max_data_extension_time_in_days = {{ max_data_extension_time_in_days }}, +data__suspend_task_after_num_failures = {{ suspend_task_after_num_failures }}, +data__trace_level = '{{ trace_level }}', +data__user_task_managed_initial_warehouse_size = '{{ user_task_managed_initial_warehouse_size }}', +data__serverless_task_min_statement_size = '{{ serverless_task_min_statement_size }}', +data__serverless_task_max_statement_size = '{{ serverless_task_max_statement_size }}', +data__user_task_timeout_ms = {{ user_task_timeout_ms }} WHERE -name = '{{ name }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required; ``` + + + -## `DELETE` example +## `DELETE` examples + + + Deletes the specified database. If you enable the `ifExists` parameter, the operation succeeds even if the database does not exist. Otherwise, a 404 failure is returned if the database does not exist. if the drop is unsuccessful. ```sql -/*+ delete */ DELETE FROM snowflake.database.databases -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}' +AND restrict = '{{ restrict }}'; +``` + + + + +## Lifecycle Methods + + + + +Creates a database from a given share. + +```sql +EXEC snowflake.database.databases.create_database_from_share +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@share='{{ share }}' +@@json= +'{ +"name": "{{ name }}" +}'; +``` + + + +Creates a database from a given share. + +```sql +EXEC snowflake.database.databases.create_database_from_share_deprecated +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@share='{{ share }}'; +``` + + + +Clones an existing database, with modifiers as query parameters. You must provide the full database definition when cloning an existing database. + +```sql +EXEC snowflake.database.databases.clone_database +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@kind='{{ kind }}' +@@json= +'{ +"name": "{{ name }}", +"kind": "{{ kind }}", +"comment": "{{ comment }}", +"data_retention_time_in_days": {{ data_retention_time_in_days }}, +"default_ddl_collation": "{{ default_ddl_collation }}", +"log_level": "{{ log_level }}", +"max_data_extension_time_in_days": {{ max_data_extension_time_in_days }}, +"suspend_task_after_num_failures": {{ suspend_task_after_num_failures }}, +"trace_level": "{{ trace_level }}", +"user_task_managed_initial_warehouse_size": "{{ user_task_managed_initial_warehouse_size }}", +"serverless_task_min_statement_size": "{{ serverless_task_min_statement_size }}", +"serverless_task_max_statement_size": "{{ serverless_task_max_statement_size }}", +"user_task_timeout_ms": {{ user_task_timeout_ms }} +}'; +``` + + + +Undrops database. + +```sql +EXEC snowflake.database.databases.undrop_database +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Promotes a local database to serve as a primary database for replication. A primary database can be replicated in one or more accounts, allowing users in those accounts to query objects in each secondary (i.e. replica) database. + +```sql +EXEC snowflake.database.databases.enable_database_replication +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ignore_edition_check={{ ignore_edition_check }} +@@json= +'{ +"accounts": "{{ accounts }}" +}'; ``` + + + +Disables replication for this primary database, meaning no replica of this database (i.e. secondary database) in another account can be refreshed. Any secondary databases remain linked to the primary database, but requests to refresh a secondary database are denied. + +```sql +EXEC snowflake.database.databases.disable_database_replication +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required +@@json= +'{ +"accounts": "{{ accounts }}" +}'; +``` + + + +Refreshes a secondary database from a snapshot of its primary database. A snapshot includes changes to the objects and data. +If you call this endpoint while another refresh for the same replica database is running, it fails and returns an error. Snowflake ensures only one refresh is executed at any given time. + +```sql +EXEC snowflake.database.databases.refresh_database_replication +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Specifies a comma-separated list of accounts in your organization where a replica of this primary database can be promoted to serve as the primary database. + +```sql +EXEC snowflake.database.databases.enable_database_failover +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required +@@json= +'{ +"accounts": "{{ accounts }}" +}'; +``` + + + +Disables failover for this primary database, meaning no replica of this database (i.e. secondary database) can be promoted to serve as the primary database. + +```sql +EXEC snowflake.database.databases.disable_database_failover +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required +@@json= +'{ +"accounts": "{{ accounts }}" +}'; +``` + + + +Promotes the specified secondary (replica) database to serve as the primary database. When promoted, the database becomes writeable. At the same time, the previous primary database becomes a read-only secondary database. + +```sql +EXEC snowflake.database.databases.primary_database_failover +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/database_role/database_roles/index.md b/docs/snowflake-docs/providers/snowflake/database_role/database_roles/index.md index b5d31282b..9e7226e35 100644 --- a/docs/snowflake-docs/providers/snowflake/database_role/database_roles/index.md +++ b/docs/snowflake-docs/providers/snowflake/database_role/database_roles/index.md @@ -1,4 +1,4 @@ ---- +--- title: database_roles hide_title: false hide_table_of_contents: false @@ -28,45 +28,184 @@ Creates, updates, deletes, gets or lists a database_roles resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the database role | -| | `string` | User comment associated to an object in the dictionary | -| | `string` | Date and time when the database role was created | -| | `integer` | How many database roles this database role has been granted | -| | `integer` | How many database roles this database role has been granted to | -| | `integer` | How many roles this database role has been granted to | -| | `string` | Role that owns the database role | -| | `string` | The type of role that owns the database role | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | , | List database roles | -| | `INSERT` | | | Create a database role | -| | `DELETE` | | | Delete a database role | -| | `EXEC` | | , | Create a new database role by cloning from the specified resource | +The following fields are returned by `SELECT` queries: -
+ + +A Snowflake database role -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the database role (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringUser comment associated to an object in the dictionary
string (date-time)Date and time when the database role was created
integer (int64)How many database roles this database role has been granted
integer (int64)How many database roles this database role has been granted to
integer (int64)How many roles this database role has been granted to
stringRole that owns the database role (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the database role (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Database of the target resource. Defaults to the source's database | `string` | `-` | +## Methods -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, endpointshowLimit, fromNameList database roles
database_name, endpointcreateModeCreate a database role
database_name, name, endpointifExistsDelete a database role
database_name, name, endpointcreateMode, targetDatabaseCreate a new database role by cloning from the specified resource
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringDatabase of the target resource. Defaults to the source's database (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
## `SELECT` examples -List database roles + + +List database roles ```sql SELECT @@ -79,61 +218,49 @@ granted_to_roles, owner, owner_role_type FROM snowflake.database_role.database_roles -WHERE database_name = '{{ database_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` -## `INSERT` example + + -Create a database role + +## `INSERT` examples - + { label: 'create_database_role', value: 'create_database_role' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a database role ```sql -/*+ create */ INSERT INTO snowflake.database_role.database_roles ( data__name, data__comment, database_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', '{{ comment }}', '{{ database_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.database_role.database_roles ( -data__name, -database_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: database_roles props: - name: database_name @@ -144,24 +271,68 @@ SELECT description: Required parameter for the database_roles resource. - name: name value: string - description: >- - Name of the database role (Required parameter for the database_roles - resource.) + description: > + Name of the database role + - name: comment value: string - description: User comment associated to an object in the dictionary + description: > + User comment associated to an object in the dictionary + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a database role ```sql -/*+ delete */ DELETE FROM snowflake.database_role.database_roles -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + + + +## Lifecycle Methods + + + + +Create a new database role by cloning from the specified resource + +```sql +EXEC snowflake.database_role.database_roles.clone_database_role +@database_name='{{ database_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@targetDatabase='{{ targetDatabase }}' +@@json= +'{ +"name": "{{ name }}" +}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/database_role/future_grants/index.md b/docs/snowflake-docs/providers/snowflake/database_role/future_grants/index.md index dfdab837d..db4f7ab70 100644 --- a/docs/snowflake-docs/providers/snowflake/database_role/future_grants/index.md +++ b/docs/snowflake-docs/providers/snowflake/database_role/future_grants/index.md @@ -1,4 +1,4 @@ ---- +--- title: future_grants hide_title: false hide_table_of_contents: false @@ -28,40 +28,157 @@ Creates, updates, deletes, gets or lists a future_grants resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `object` | | -| | `string` | Date and time when the grant was created | -| | `boolean` | If true, allows the recipient role to grant the privileges to other roles. | -| | `string` | The role that granted this privilege to this grantee | -| | `array` | List of privileges to be granted. | -| | `object` | | -| | `string` | Type of the securable to be granted. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all future grants to the role | -| | `INSERT` | | - | Grant future privileges to the role | -| | `DELETE` | | | Revoke future grants from the role | +The following fields are returned by `SELECT` queries: -
+ + +successful -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
object
string (date-time)Date and time when the grant was created
booleanIf true, allows the recipient role to grant the privileges to other roles.
stringThe role that granted this privilege to this grantee
arrayList of privileges to be granted.
object
stringType of the securable to be granted.
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, name, endpointshowLimitList all future grants to the role
database_name, name, endpointGrant future privileges to the role
database_name, name, endpointmodeRevoke future grants from the role
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. (enum: [restrict, cascade], example: restrict)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all future grants to the role + + +List all future grants to the role ```sql SELECT @@ -73,26 +190,29 @@ privileges, securable, securable_type FROM snowflake.database_role.future_grants -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; ``` -## `INSERT` example + + -Grant future privileges to the role + +## `INSERT` examples - + { label: 'grant_future_privileges', value: 'grant_future_privileges' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Grant future privileges to the role ```sql -/*+ create */ INSERT INTO snowflake.database_role.future_grants ( data__securable, data__containing_scope, @@ -115,30 +235,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.database_role.future_grants ( -data__securable_type, -database_name, -name, -endpoint -) -SELECT -'{{ securable_type }}', -'{{ database_name }}', -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: future_grants props: - name: database_name @@ -151,41 +251,47 @@ SELECT value: string description: Required parameter for the future_grants resource. - name: securable - value: - database: string - schema: string - service: string - name: string + value: object - name: containing_scope - value: - database: string - schema: string + value: object - name: securable_type value: string - description: >- - Type of the securable to be granted. (Required parameter for the - future_grants resource.) + description: > + Type of the securable to be granted. + - name: grant_option value: boolean - description: >- - If true, allows the recipient role to grant the privileges to other - roles. + description: > + If true, allows the recipient role to grant the privileges to other roles. + - name: privileges value: array - description: List of privileges to be granted. + description: > + List of privileges to be granted. + ``` -## `DELETE` example + +## `DELETE` examples + + + Revoke future grants from the role ```sql -/*+ delete */ DELETE FROM snowflake.database_role.future_grants -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND data__securable_type = '{{ data__securable_type }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND mode = '{{ mode }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/database_role/grants/index.md b/docs/snowflake-docs/providers/snowflake/database_role/grants/index.md index 62d62e3de..ee7bd104a 100644 --- a/docs/snowflake-docs/providers/snowflake/database_role/grants/index.md +++ b/docs/snowflake-docs/providers/snowflake/database_role/grants/index.md @@ -1,4 +1,4 @@ ---- +--- title: grants hide_title: false hide_table_of_contents: false @@ -28,40 +28,157 @@ Creates, updates, deletes, gets or lists a grants resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `object` | | -| | `string` | Date and time when the grant was created | -| | `boolean` | If true, allows the recipient role to grant the privileges to other roles. | -| | `string` | The role that granted this privilege to this grantee | -| | `array` | List of privileges to be granted. | -| | `object` | | -| | `string` | Type of the securable to be granted. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all grants to the role | -| | `INSERT` | | - | Grant privileges to the role | -| | `DELETE` | | | Revoke grants from the role | +The following fields are returned by `SELECT` queries: -
+ + +successful -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
object
string (date-time)Date and time when the grant was created
booleanIf true, allows the recipient role to grant the privileges to other roles.
stringThe role that granted this privilege to this grantee
arrayList of privileges to be granted.
object
stringType of the securable to be granted.
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, name, endpointshowLimitList all grants to the role
database_name, name, endpointGrant privileges to the role
database_name, name, endpointmodeRevoke grants from the role
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. (enum: [restrict, cascade], example: restrict)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all grants to the role + + +List all grants to the role ```sql SELECT @@ -73,26 +190,29 @@ privileges, securable, securable_type FROM snowflake.database_role.grants -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; ``` -## `INSERT` example + + -Grant privileges to the role + +## `INSERT` examples - + { label: 'grant_privileges', value: 'grant_privileges' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Grant privileges to the role ```sql -/*+ create */ INSERT INTO snowflake.database_role.grants ( data__securable, data__containing_scope, @@ -115,30 +235,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.database_role.grants ( -data__securable_type, -database_name, -name, -endpoint -) -SELECT -'{{ securable_type }}', -'{{ database_name }}', -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: grants props: - name: database_name @@ -151,41 +251,47 @@ SELECT value: string description: Required parameter for the grants resource. - name: securable - value: - database: string - schema: string - service: string - name: string + value: object - name: containing_scope - value: - database: string - schema: string + value: object - name: securable_type value: string - description: >- - Type of the securable to be granted. (Required parameter for the grants - resource.) + description: > + Type of the securable to be granted. + - name: grant_option value: boolean - description: >- - If true, allows the recipient role to grant the privileges to other - roles. + description: > + If true, allows the recipient role to grant the privileges to other roles. + - name: privileges value: array - description: List of privileges to be granted. + description: > + List of privileges to be granted. + ``` -## `DELETE` example + +## `DELETE` examples + + + Revoke grants from the role ```sql -/*+ delete */ DELETE FROM snowflake.database_role.grants -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND data__securable_type = '{{ data__securable_type }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND mode = '{{ mode }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/dynamic_table/dynamic_tables/index.md b/docs/snowflake-docs/providers/snowflake/dynamic_table/dynamic_tables/index.md index 78358a65b..556d2a1a0 100644 --- a/docs/snowflake-docs/providers/snowflake/dynamic_table/dynamic_tables/index.md +++ b/docs/snowflake-docs/providers/snowflake/dynamic_table/dynamic_tables/index.md @@ -1,4 +1,4 @@ ---- +--- title: dynamic_tables hide_title: false hide_table_of_contents: false @@ -28,67 +28,460 @@ Creates, updates, deletes, gets or lists a dynamic_tables resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Specifies the name for the dynamic table, must be unique for the schema in which the dynamic table is created | -| | `boolean` | If Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the dynamic table. | -| | `string` | Name of the budget if the object is monitored by a budget | -| | `integer` | Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table | -| | `array` | Specifies one or more columns or column expressions in the dynamic table as the clustering key | -| | `array` | | -| | `string` | Specifies a comment for the dynamic table. | -| | `string` | Date and time when the dynamic table was created. | -| | `integer` | Specifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table | -| | `string` | Database in which the dynamic table is stored | -| | `string` | Specifies the behavior of the initial refresh of the dynamic table | -| | `string` | Specifies the dynamic table type, permanent (default) or transient. | -| | `integer` | Specifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table | -| | `string` | Role that owns the table | -| | `string` | The type of role that owns the object. | -| | `string` | Specifies the query whose results the dynamic table should contain | -| | `string` | Specifies the refresh type for the dynamic table | -| | `integer` | Number of rows in the dynamic table. | -| | `string` | Scheduling state (RUNNING or SUSPENDED) | -| | `string` | Schema in which the dynamic table is stored | -| | `object` | Specifies the schedule for periodically refreshing the dynamic table. | -| | `string` | Specifies the name of the warehouse that provides the compute resources for refreshing the dynamic table | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake dynamic table object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringSpecifies the name for the dynamic table, must be unique for the schema in which the dynamic table is created
stringDatabase in which the dynamic table is stored
stringSchema in which the dynamic table is stored
booleanIf Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the dynamic table.
stringName of the budget if the object is monitored by a budget
integer (int64)Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table
arraySpecifies one or more columns or column expressions in the dynamic table as the clustering key
array
stringSpecifies a comment for the dynamic table.
string (date-time)Date and time when the dynamic table was created.
integerSpecifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table
stringSpecifies the behavior of the initial refresh of the dynamic table
stringSpecifies the dynamic table type, permanent (default) or transient. (default: PERMANENT)
integerSpecifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table
stringRole that owns the table
stringThe type of role that owns the object.
stringSpecifies the query whose results the dynamic table should contain (example: SELECT * FROM foo)
stringSpecifies the refresh type for the dynamic table
integer (int64)Number of rows in the dynamic table.
stringScheduling state (RUNNING or SUSPENDED)
objectSpecifies the schedule for periodically refreshing the dynamic table.
stringSpecifies the name of the warehouse that provides the compute resources for refreshing the dynamic table (example: test_wh)
+
+ + +A Snowflake dynamic table object. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringSpecifies the name for the dynamic table, must be unique for the schema in which the dynamic table is created
stringDatabase in which the dynamic table is stored
stringSchema in which the dynamic table is stored
booleanIf Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the dynamic table.
stringName of the budget if the object is monitored by a budget
integer (int64)Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table
arraySpecifies one or more columns or column expressions in the dynamic table as the clustering key
array
stringSpecifies a comment for the dynamic table.
string (date-time)Date and time when the dynamic table was created.
integerSpecifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table
stringSpecifies the behavior of the initial refresh of the dynamic table
stringSpecifies the dynamic table type, permanent (default) or transient. (default: PERMANENT)
integerSpecifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table
stringRole that owns the table
stringThe type of role that owns the object.
stringSpecifies the query whose results the dynamic table should contain (example: SELECT * FROM foo)
stringSpecifies the refresh type for the dynamic table
integer (int64)Number of rows in the dynamic table.
stringScheduling state (RUNNING or SUSPENDED)
objectSpecifies the schedule for periodically refreshing the dynamic table.
stringSpecifies the name of the warehouse that provides the compute resources for refreshing the dynamic table (example: test_wh)
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a Dynamic Table. | -| | `SELECT` | | , , , , | Lists the dynamic tables under the database and schema. | -| | `INSERT` | | | Create a dynamic table, with standard create modifiers as query parameters. See the Dynamic Table component definition for what is required to be provided in the request body. | -| | `DELETE` | | | Delete a dynamic table with the given name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful. | -| | `EXEC` | | , , , | Create a new dynamic table by cloning from the specified resource | -| | `EXEC` | | | Specifies that the dynamic table should be manually refreshed | -| | `EXEC` | | | Resume refreshes on the dynamic table | -| | `EXEC` | | | Resume recluster of a dynamic table | -| | `EXEC` | | | Suspend refreshes on the dynamic table | -| | `EXEC` | | | Suspend recluster of a dynamic table | -| | `EXEC` | | , , | Swap with another dynamic table | -| | `EXEC` | | - | Undrop specified dynamic table | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Optionally includes dependency information of the dynamic table. | `boolean` | `-` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | -| | Database of the newly created dynamic table. Defaults to the source table's database. | `string` | `-` | -| | Schema of the newly created dynamic table. Defaults to the source table's schema. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromName, deepLists the dynamic tables under the database and schema.
database_name, schema_name, name, endpointFetch a Dynamic Table.
database_name, schema_name, endpointcreateModeCreate a dynamic table, with standard create modifiers as query parameters. See the Dynamic Table component definition for what is required to be provided in the request body.
database_name, schema_name, name, endpointifExistsDelete a dynamic table with the given name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful.
database_name, schema_name, name, endpointcreateMode, copyGrants, targetDatabase, targetSchemaCreate a new dynamic table by cloning from the specified resource
database_name, schema_name, name, endpointUndrop specified dynamic table
database_name, schema_name, name, endpointifExistsSuspend refreshes on the dynamic table
database_name, schema_name, name, endpointifExistsResume refreshes on the dynamic table
database_name, schema_name, name, endpointifExistsSpecifies that the dynamic table should be manually refreshed
database_name, schema_name, name, endpointifExistsSuspend recluster of a dynamic table
database_name, schema_name, name, endpointifExistsResume recluster of a dynamic table
database_name, schema_name, name, targetName, endpointifExists, targetDatabase, targetSchemaSwap with another dynamic table
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe name of the target dynamic table to be swapped with. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanOptionally includes dependency information of the dynamic table.
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
stringDatabase of the target dynamic table. Defaults to the source table's database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSchema of the target dynamic table. Defaults to the source table's schema. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
## `SELECT` examples @@ -97,8 +490,8 @@ Creates, updates, deletes, gets or lists a dynamic_tables resource. values={[ { label: 'list_dynamic_tables', value: 'list_dynamic_tables' }, { label: 'fetch_dynamic_table', value: 'fetch_dynamic_table' } - ] -}> + ]} +> Lists the dynamic tables under the database and schema. @@ -106,6 +499,8 @@ Lists the dynamic tables under the database and schema. ```sql SELECT name, +database_name, +schema_name, automatic_clustering, budget, bytes, @@ -114,7 +509,6 @@ columns, comment, created_on, data_retention_time_in_days, -database_name, initialize, kind, max_data_extension_time_in_days, @@ -124,13 +518,17 @@ query, refresh_mode, rows, scheduling_state, -schema_name, target_lag, warehouse FROM snowflake.dynamic_table.dynamic_tables -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}' +AND deep = '{{ deep }}'; ``` @@ -140,6 +538,8 @@ Fetch a Dynamic Table. ```sql SELECT name, +database_name, +schema_name, automatic_clustering, budget, bytes, @@ -148,7 +548,6 @@ columns, comment, created_on, data_retention_time_in_days, -database_name, initialize, kind, max_data_extension_time_in_days, @@ -158,34 +557,32 @@ query, refresh_mode, rows, scheduling_state, -schema_name, target_lag, warehouse FROM snowflake.dynamic_table.dynamic_tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a dynamic table, with standard create modifiers as query parameters. See the Dynamic Table component definition for what is required to be provided in the request body. +## `INSERT` examples - + { label: 'create_dynamic_table', value: 'create_dynamic_table' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a dynamic table, with standard create modifiers as query parameters. See the Dynamic Table component definition for what is required to be provided in the request body. ```sql -/*+ create */ INSERT INTO snowflake.dynamic_table.dynamic_tables ( data__name, data__kind, @@ -201,7 +598,8 @@ data__max_data_extension_time_in_days, data__comment, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -218,40 +616,15 @@ SELECT '{{ comment }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.dynamic_table.dynamic_tables ( -data__name, -data__target_lag, -data__warehouse, -data__query, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ target_lag }}', -'{{ warehouse }}', -'{{ query }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: dynamic_tables props: - name: database_name @@ -265,87 +638,226 @@ SELECT description: Required parameter for the dynamic_tables resource. - name: name value: string - description: >- - Specifies the name for the dynamic table, must be unique for the schema - in which the dynamic table is created (Required parameter for the - dynamic_tables resource.) + description: > + Specifies the name for the dynamic table, must be unique for the schema in which the dynamic table is created + - name: kind value: string - description: >- + description: > Specifies the dynamic table type, permanent (default) or transient. - (valid values: 'PERMANENT', 'TRANSIENT') + + valid_values: ['PERMANENT', 'TRANSIENT'] default: PERMANENT - name: columns - value: - - name: name - value: string - description: Column name - - name: datatype - value: string - description: The data type for the column - - name: comment - value: string - description: Specifies a comment for the column + value: array - name: target_lag - value: - type: string - description: >- + value: object + description: > Specifies the schedule for periodically refreshing the dynamic table. - (Required parameter for the dynamic_tables resource.) + - name: refresh_mode value: string - description: >- - Specifies the refresh type for the dynamic table (valid values: 'AUTO', - 'FULL', 'INCREMENTAL') + description: > + Specifies the refresh type for the dynamic table + + valid_values: ['AUTO', 'FULL', 'INCREMENTAL'] - name: initialize value: string - description: >- + description: > Specifies the behavior of the initial refresh of the dynamic table - (valid values: 'ON_CREATE', 'ON_SCHEDULE') + + valid_values: ['ON_CREATE', 'ON_SCHEDULE'] - name: warehouse value: string - description: >- - Specifies the name of the warehouse that provides the compute resources - for refreshing the dynamic table (Required parameter for the - dynamic_tables resource.) + description: > + Specifies the name of the warehouse that provides the compute resources for refreshing the dynamic table + - name: cluster_by value: array - description: >- - Specifies one or more columns or column expressions in the dynamic table - as the clustering key + description: > + Specifies one or more columns or column expressions in the dynamic table as the clustering key + - name: query value: string - description: >- + description: > Specifies the query whose results the dynamic table should contain - (Required parameter for the dynamic_tables resource.) + - name: data_retention_time_in_days value: integer - description: >- - Specifies the retention period for the dynamic table so that Time Travel - actions (SELECT, CLONE) can be performed on historical data in the - dynamic table + description: > + Specifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table + - name: max_data_extension_time_in_days value: integer - description: >- - Specifies the retention period for the dynamic table so that Time Travel - actions (SELECT, CLONE) can be performed on historical data in the - dynamic table + description: > + Specifies the retention period for the dynamic table so that Time Travel actions (SELECT, CLONE) can be performed on historical data in the dynamic table + - name: comment value: string - description: Specifies a comment for the dynamic table. + description: > + Specifies a comment for the dynamic table. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a dynamic table with the given name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful. ```sql -/*+ delete */ DELETE FROM snowflake.dynamic_table.dynamic_tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Create a new dynamic table by cloning from the specified resource + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.clone_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}' +@@json= +'{ +"name": "{{ name }}", +"target_lag": "{{ target_lag }}", +"warehouse": "{{ warehouse }}", +"point_of_time": "{{ point_of_time }}" +}'; +``` + + + +Undrop specified dynamic table + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.undrop_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Suspend refreshes on the dynamic table + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.suspend_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; ``` + + + +Resume refreshes on the dynamic table + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.resume_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Specifies that the dynamic table should be manually refreshed + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.refresh_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Suspend recluster of a dynamic table + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.suspend_recluster_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Resume recluster of a dynamic table + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.resume_recluster_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Swap with another dynamic table + +```sql +EXEC snowflake.dynamic_table.dynamic_tables.swap_with_dynamic_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetName='{{ targetName }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/event_table/event_tables/index.md b/docs/snowflake-docs/providers/snowflake/event_table/event_tables/index.md index 34e6753f2..5e0f11652 100644 --- a/docs/snowflake-docs/providers/snowflake/event_table/event_tables/index.md +++ b/docs/snowflake-docs/providers/snowflake/event_table/event_tables/index.md @@ -1,4 +1,4 @@ ---- +--- title: event_tables hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a event_tables resource. +Creates, updates, deletes, gets or lists an event_tables resource. ## Overview @@ -28,54 +28,366 @@ Creates, updates, deletes, gets or lists a event_tables resource.
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the event table | -| | `boolean` | If Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table. | -| | `integer` | Number of bytes that will be scanned if the entire table is scanned in a query.Note that this number may be different than the number of actual physical bytes stored on-disk for the table | -| | `boolean` | True if change tracking is enabled, allowing streams and CHANGES to be used on the entity. | -| | `array` | Cluster key column(s) or expression | -| | `array` | | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | Date and time when the event table was created. | -| | `integer` | number of days to retain the old version of deleted/updated data | -| | `string` | Database in which the event table is stored | -| | `string` | Collation that is used for all the new columns created by the DDL statements (if not specified) | -| | `integer` | Maximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale. | -| | `string` | Role that owns the event table | -| | `string` | The type of role that owns the event table | -| | `integer` | Number of rows in the table. | -| | `string` | Schema in which the event table is stored | -| | `boolean` | If ON, the table has the search optimization service enabled | -| | `integer` | Number of additional bytes of storage that the search optimization service consumes for this table | -| | `integer` | Percentage of the table that has been optimized for search | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch an event table | -| | `SELECT` | | , , , | List event tables | -| | `INSERT` | | , | Create an event table | -| | `DELETE` | | | Delete an event table | -| | `EXEC` | | | Rename the event table | +The following fields are returned by `SELECT` queries: + + + + +A Snowflake event table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the event table
stringDatabase in which the event table is stored
stringSchema in which the event table is stored
booleanIf Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table.
integer (int64)Number of bytes that will be scanned if the entire table is scanned in a query.Note that this number may be different than the number of actual physical bytes stored on-disk for the table
booleanTrue if change tracking is enabled, allowing streams and CHANGES to be used on the entity.
arrayCluster key column(s) or expression
array
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the event table was created.
integernumber of days to retain the old version of deleted/updated data
stringCollation that is used for all the new columns created by the DDL statements (if not specified)
integerMaximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale.
stringRole that owns the event table
stringThe type of role that owns the event table
integer (int64)Number of rows in the table.
booleanIf ON, the table has the search optimization service enabled
integer (int64)Number of additional bytes of storage that the search optimization service consumes for this table
integer (int64)Percentage of the table that has been optimized for search
+
+ + +A Snowflake event table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the event table
stringDatabase in which the event table is stored
stringSchema in which the event table is stored
booleanIf Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table.
integer (int64)Number of bytes that will be scanned if the entire table is scanned in a query.Note that this number may be different than the number of actual physical bytes stored on-disk for the table
booleanTrue if change tracking is enabled, allowing streams and CHANGES to be used on the entity.
arrayCluster key column(s) or expression
array
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the event table was created.
integernumber of days to retain the old version of deleted/updated data
stringCollation that is used for all the new columns created by the DDL statements (if not specified)
integerMaximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale.
stringRole that owns the event table
stringThe type of role that owns the event table
integer (int64)Number of rows in the table.
booleanIf ON, the table has the search optimization service enabled
integer (int64)Number of additional bytes of storage that the search optimization service consumes for this table
integer (int64)Percentage of the table that has been optimized for search
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromNameList event tables
database_name, schema_name, name, endpointFetch an event table
database_name, schema_name, endpointcreateMode, copyGrantsCreate an event table
database_name, schema_name, name, endpointifExistsDelete an event table
database_name, schema_name, name, targetName, endpointifExistsRename the event table
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSpecify the name of the target resource to be renamed to.
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -84,8 +396,8 @@ Creates, updates, deletes, gets or lists a event_tables resource. values={[ { label: 'list_event_tables', value: 'list_event_tables' }, { label: 'fetch_event_table', value: 'fetch_event_table' } - ] -}> + ]} +> List event tables @@ -93,6 +405,8 @@ List event tables ```sql SELECT name, +database_name, +schema_name, automatic_clustering, bytes, change_tracking, @@ -101,20 +415,22 @@ columns, comment, created_on, data_retention_time_in_days, -database_name, default_ddl_collation, max_data_extension_time_in_days, owner, owner_role_type, rows, -schema_name, search_optimization, search_optimization_bytes, search_optimization_progress FROM snowflake.event_table.event_tables -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` @@ -124,6 +440,8 @@ Fetch an event table ```sql SELECT name, +database_name, +schema_name, automatic_clustering, bytes, change_tracking, @@ -132,41 +450,38 @@ columns, comment, created_on, data_retention_time_in_days, -database_name, default_ddl_collation, max_data_extension_time_in_days, owner, owner_role_type, rows, -schema_name, search_optimization, search_optimization_bytes, search_optimization_progress FROM snowflake.event_table.event_tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create an event table +## `INSERT` examples - + { label: 'create_event_table', value: 'create_event_table' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create an event table ```sql -/*+ create */ INSERT INTO snowflake.event_table.event_tables ( data__name, data__cluster_by, @@ -177,7 +492,9 @@ data__default_ddl_collation, data__comment, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -189,34 +506,16 @@ SELECT '{{ comment }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.event_table.event_tables ( -data__name, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: event_tables props: - name: database_name @@ -230,46 +529,94 @@ SELECT description: Required parameter for the event_tables resource. - name: name value: string - description: >- - Name of the event table (Required parameter for the event_tables - resource.) + description: > + Name of the event table + - name: cluster_by value: array - description: Cluster key column(s) or expression + description: > + Cluster key column(s) or expression + - name: data_retention_time_in_days value: integer - description: number of days to retain the old version of deleted/updated data + description: > + number of days to retain the old version of deleted/updated data + - name: max_data_extension_time_in_days value: integer - description: >- - Maximum number of days to extend data retention beyond the retention - period to prevent a stream becoming stale. + description: > + Maximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale. + - name: change_tracking value: boolean - description: >- - True if change tracking is enabled, allowing streams and CHANGES to be - used on the entity. + description: > + True if change tracking is enabled, allowing streams and CHANGES to be used on the entity. + - name: default_ddl_collation value: string - description: >- - Collation that is used for all the new columns created by the DDL - statements (if not specified) + description: > + Collation that is used for all the new columns created by the DDL statements (if not specified) + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete an event table ```sql -/*+ delete */ DELETE FROM snowflake.event_table.event_tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Rename the event table + +```sql +EXEC snowflake.event_table.event_tables.rename_event_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetName='{{ targetName }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/external_volume/external_volumes/index.md b/docs/snowflake-docs/providers/snowflake/external_volume/external_volumes/index.md index 888219f35..ad88ffd07 100644 --- a/docs/snowflake-docs/providers/snowflake/external_volume/external_volumes/index.md +++ b/docs/snowflake-docs/providers/snowflake/external_volume/external_volumes/index.md @@ -1,4 +1,4 @@ ---- +--- title: external_volumes hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a external_volumes resource. +Creates, updates, deletes, gets or lists an external_volumes resource. ## Overview @@ -28,38 +28,211 @@ Creates, updates, deletes, gets or lists a external_volumes resourc
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | String that specifies the identifier (the name) for the external volume; must be unique in your account. | -| | `boolean` | Specifies whether write operations are allowed for the external volume; must be set to TRUE for Iceberg tables that use Snowflake as the catalog. | -| | `string` | String (literal) that specifies a comment for the external volume. | -| | `string` | Date and time when the external volume was created. | -| | `string` | Role that owns the external volume | -| | `string` | The type of role that owns the external volume | -| | `array` | Set of named cloud storage locations in different regions and, optionally, cloud platforms. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch an external volume | -| | `SELECT` | | | List external volumes | -| | `INSERT` | | | Create an external volume | -| | `DELETE` | | | Delete an external volume | -| | `EXEC` | | - | Undrop an external volume | +The following fields are returned by `SELECT` queries: + + + -
+A Snowflake external volume + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringString that specifies the identifier (the name) for the external volume; must be unique in your account. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether write operations are allowed for the external volume; must be set to TRUE for Iceberg tables that use Snowflake as the catalog.
stringString (literal) that specifies a comment for the external volume.
string (date-time)Date and time when the external volume was created.
stringRole that owns the external volume (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the external volume (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arraySet of named cloud storage locations in different regions and, optionally, cloud platforms.
+
+ -
-Optional Parameter Details +A Snowflake external volume -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringString that specifies the identifier (the name) for the external volume; must be unique in your account. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether write operations are allowed for the external volume; must be set to TRUE for Iceberg tables that use Snowflake as the catalog.
stringString (literal) that specifies a comment for the external volume.
string (date-time)Date and time when the external volume was created.
stringRole that owns the external volume (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the external volume (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arraySet of named cloud storage locations in different regions and, optionally, cloud platforms.
+ + -
+## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlikeList external volumes
name, endpointFetch an external volume
endpointcreateModeCreate an external volume
name, endpointifExistsDelete an external volume
name, endpointUndrop an external volume
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -68,8 +241,8 @@ Creates, updates, deletes, gets or lists a external_volumes resourc values={[ { label: 'list_external_volumes', value: 'list_external_volumes' }, { label: 'fetch_external_volume', value: 'fetch_external_volume' } - ] -}> + ]} +> List external volumes @@ -84,7 +257,8 @@ owner, owner_role_type, storage_locations FROM snowflake.external_volume.external_volumes -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -101,66 +275,49 @@ owner, owner_role_type, storage_locations FROM snowflake.external_volume.external_volumes -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create an external volume +## `INSERT` examples - + { label: 'create_external_volume', value: 'create_external_volume' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create an external volume ```sql -/*+ create */ INSERT INTO snowflake.external_volume.external_volumes ( data__name, data__storage_locations, data__allow_writes, data__comment, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', '{{ storage_locations }}', {{ allow_writes }}, '{{ comment }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.external_volume.external_volumes ( -data__name, -data__storage_locations, -endpoint -) -SELECT -'{{ name }}', -'{{ storage_locations }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: external_volumes props: - name: endpoint @@ -168,43 +325,70 @@ SELECT description: Required parameter for the external_volumes resource. - name: name value: string - description: >- - String that specifies the identifier (the name) for the external volume; - must be unique in your account. (Required parameter for the - external_volumes resource.) + description: > + String that specifies the identifier (the name) for the external volume; must be unique in your account. + - name: storage_locations - value: - - name: name - value: string - - name: storage_provider - value: string - description: >- - Specifies the cloud storage provider that stores your data files. - (valid values: 'S3', 'S3GOV', 'GCS', 'AZURE') - description: >- - Set of named cloud storage locations in different regions and, - optionally, cloud platforms. (Required parameter for the - external_volumes resource.) + value: array + description: > + Set of named cloud storage locations in different regions and, optionally, cloud platforms. + - name: allow_writes value: boolean - description: >- - Specifies whether write operations are allowed for the external volume; - must be set to TRUE for Iceberg tables that use Snowflake as the - catalog. + description: > + Specifies whether write operations are allowed for the external volume; must be set to TRUE for Iceberg tables that use Snowflake as the catalog. + - name: comment value: string - description: String (literal) that specifies a comment for the external volume. + description: > + String (literal) that specifies a comment for the external volume. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete an external volume ```sql -/*+ delete */ DELETE FROM snowflake.external_volume.external_volumes -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + + + +## Lifecycle Methods + + + + +Undrop an external volume + +```sql +EXEC snowflake.external_volume.external_volumes.undrop_external_volume +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/function/functions/index.md b/docs/snowflake-docs/providers/snowflake/function/functions/index.md index ecc820dc4..8f6e65530 100644 --- a/docs/snowflake-docs/providers/snowflake/function/functions/index.md +++ b/docs/snowflake-docs/providers/snowflake/function/functions/index.md @@ -1,4 +1,4 @@ ---- +--- title: functions hide_title: false hide_table_of_contents: false @@ -28,40 +28,246 @@ Creates, updates, deletes, gets or lists a functions resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Specifies the name for the function, must be unique for the schema in which the function is created | -| | `array` | | -| | `string` | Function's body. | -| | `string` | Date and time when the function was created. | -| | `string` | | -| | `string` | Function's language. | -| | `integer` | Specifies the max rows for batch operation. | -| | `string` | Specifies the type for the function return value. | -| | `string` | Function's arguments. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a Function using the describe command output. | -| | `SELECT` | | | Lists the user functions under the database and schema. | -| | `INSERT` | | | Create a function. | -| | `DELETE` | | | Delete a function with the given name and args. | -| | `EXEC` | | - | Execute a Function. | +The following fields are returned by `SELECT` queries: -
+ + +A Snowflake function -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringSpecifies the name for the function, must be unique for the schema in which the function is created
array
stringFunction's body.
string (date-time)Date and time when the function was created.
string (default: service-function)
stringFunction's language.
integerSpecifies the max rows for batch operation.
stringSpecifies the type for the function return value. (default: TEXT)
stringFunction's arguments.
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | +A Snowflake function + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringSpecifies the name for the function, must be unique for the schema in which the function is created
array
stringFunction's body.
string (date-time)Date and time when the function was created.
string (default: service-function)
stringFunction's language.
integerSpecifies the max rows for batch operation.
stringSpecifies the type for the function return value. (default: TEXT)
stringFunction's arguments.
+
+ + +## Methods -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlikeLists the user functions under the database and schema.
database_name, schema_name, nameWithArgs, endpointFetch a Function using the describe command output.
database_name, schema_name, endpointcreateModeCreate a function.
database_name, schema_name, nameWithArgs, endpointifExistsDelete a function with the given name and args.
database_name, schema_name, name, endpointExecute a Function.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringFunction's name with Args (example: foo(a number, b number))
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -70,8 +276,8 @@ Creates, updates, deletes, gets or lists a functions resource. values={[ { label: 'list_functions', value: 'list_functions' }, { label: 'fetch_function', value: 'fetch_function' } - ] -}> + ]} +> Lists the user functions under the database and schema. @@ -88,9 +294,10 @@ max_batch_rows, returns, signature FROM snowflake.function.functions -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -109,30 +316,29 @@ max_batch_rows, returns, signature FROM snowflake.function.functions -WHERE database_name = '{{ database_name }}' -AND nameWithArgs = '{{ nameWithArgs }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND nameWithArgs = '{{ nameWithArgs }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a function. +## `INSERT` examples - + { label: 'create_function', value: 'create_function' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a function. ```sql -/*+ create */ INSERT INTO snowflake.function.functions ( data__function_type, data__name, @@ -145,7 +351,8 @@ data__language, data__body, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ function_type }}', @@ -159,36 +366,15 @@ SELECT '{{ body }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.function.functions ( -data__name, -data__arguments, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ arguments }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: functions props: - name: database_name @@ -205,61 +391,93 @@ SELECT default: service-function - name: name value: string - description: >- - Specifies the name for the function, must be unique for the schema in - which the function is created (Required parameter for the functions - resource.) + description: > + Specifies the name for the function, must be unique for the schema in which the function is created + - name: arguments - value: - - name: name - value: string - description: Argument's name - - name: datatype - value: string - description: >- - Argument's type (valid values: 'FIXED', 'INT', 'REAL', 'NUMBER', - 'TEXT', 'BOOLEAN', 'DATE', 'TIME', 'TIMESTAMP_TZ', 'TIMESTAMP_LTZ', - 'TIMESTAMP_NTZ') - default: TEXT - - name: value - value: string - description: Argument's value - description: Required parameter for the functions resource. + value: array - name: returns value: string - description: >- - Specifies the type for the function return value. (valid values: - 'FIXED', 'INT', 'REAL', 'NUMBER', 'TEXT', 'BOOLEAN', 'DATE', 'TIME', - 'TIMESTAMP_TZ', 'TIMESTAMP_LTZ', 'TIMESTAMP_NTZ') + description: > + Specifies the type for the function return value. + + valid_values: ['FIXED', 'INT', 'REAL', 'NUMBER', 'TEXT', 'BOOLEAN', 'DATE', 'TIME', 'TIMESTAMP_TZ', 'TIMESTAMP_LTZ', 'TIMESTAMP_NTZ'] default: TEXT - name: max_batch_rows value: integer - description: Specifies the max rows for batch operation. + description: > + Specifies the max rows for batch operation. + - name: created_on value: string - description: Date and time when the function was created. + description: > + Date and time when the function was created. + - name: signature value: string - description: Function's arguments. + description: > + Function's arguments. + - name: language value: string - description: Function's language. + description: > + Function's language. + - name: body value: string - description: Function's body. + description: > + Function's body. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a function with the given name and args. ```sql -/*+ delete */ DELETE FROM snowflake.function.functions -WHERE database_name = '{{ database_name }}' -AND nameWithArgs = '{{ nameWithArgs }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND nameWithArgs = '{{ nameWithArgs }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Execute a Function. + +```sql +EXEC snowflake.function.functions.execute_function +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/grant/grant_options/index.md b/docs/snowflake-docs/providers/snowflake/grant/grant_options/index.md index de3690c37..815779db1 100644 --- a/docs/snowflake-docs/providers/snowflake/grant/grant_options/index.md +++ b/docs/snowflake-docs/providers/snowflake/grant/grant_options/index.md @@ -1,4 +1,4 @@ ---- +--- title: grant_options hide_title: false hide_table_of_contents: false @@ -28,38 +28,152 @@ Creates, updates, deletes, gets or lists a grant_options resource. ## Fields + +The following fields are returned by `SELECT` queries: + `SELECT` not supported for this resource, use `SHOW METHODS` to view available operations for the resource. ## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `DELETE` | | | Endpoint to indicate that the grant option for the privilege listed on the group securable in the given scope should be revoked. | -| | `DELETE` | | | Endpoint to indicate that the grant option for the privilege listed in the path should be revoked. | -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
granteeType, granteeName, securableType, securableName, privilege, endpointdeleteModeEndpoint to indicate that the grant option for the privilege listed in the path should be revoked.
granteeType, granteeName, bulkGrantType, securableTypePlural, scopeType, scopeName, privilege, endpointdeleteModeEndpoint to indicate that the grant option for the privilege listed on the group securable in the given scope should be revoked.
## Parameters -
-Optional Parameter Details +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | If "cascade", recursively revoke the grant from sub-grantees to which this privilege was re-granted. Acceptable values are "restrict" or "cascade". | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringString that species whether this group privilege should be on ALL or FUTURE resources of the specified plural type (example: all, enum: [all, future])
stringOrganization and Account Name (default: orgid-acctid)
stringString that specifies the name of the privilege grantee. (example: SYSADMIN)
stringString that specifies the type of resource that is the privilege grantee. (example: role, enum: [user, role, application-role, database-role, share])
stringString that specifies a privilege to be revoked (example: SELECT)
stringString that specifies the name of resource that is the scope of an ALL/FUTURE privilege (example: MY_DB.MY_SC)
stringString that specifies the type of resource that is the scope of an ALL/FUTURE privilege. Can only be DATABASE or SCHEMA (example: schema, enum: [database, schema])
stringString that specifies the name of resource that is being secured by a privilege. (example: MY_DB)
stringString that specifies the type of resource that is being secured by a privilege. (example: DATABASE)
stringString that specifies the plural of the type of resource that is being secured by an ALL/FUTURE privilege. Must be either "schemas" or any plural object type that can nest under a schema such as "tables" (example: tables)
stringIf "cascade", recursively revoke the grant from sub-grantees to which this privilege was re-granted. Acceptable values are "restrict" or "cascade". (example: restrict)
-
+## `DELETE` examples -## `DELETE` example + + Endpoint to indicate that the grant option for the privilege listed in the path should be revoked. ```sql -/*+ delete */ DELETE FROM snowflake.grant.grant_options -WHERE granteeName = '{{ granteeName }}' -AND granteeType = '{{ granteeType }}' -AND privilege = '{{ privilege }}' -AND securableName = '{{ securableName }}' -AND securableType = '{{ securableType }}' -AND endpoint = '{{ endpoint }}'; +WHERE granteeType = '{{ granteeType }}' --required +AND granteeName = '{{ granteeName }}' --required +AND securableType = '{{ securableType }}' --required +AND securableName = '{{ securableName }}' --required +AND privilege = '{{ privilege }}' --required +AND endpoint = '{{ endpoint }}' --required +AND deleteMode = '{{ deleteMode }}'; +``` + + + +Endpoint to indicate that the grant option for the privilege listed on the group securable in the given scope should be revoked. + +```sql +DELETE FROM snowflake.grant.grant_options +WHERE granteeType = '{{ granteeType }}' --required +AND granteeName = '{{ granteeName }}' --required +AND bulkGrantType = '{{ bulkGrantType }}' --required +AND securableTypePlural = '{{ securableTypePlural }}' --required +AND scopeType = '{{ scopeType }}' --required +AND scopeName = '{{ scopeName }}' --required +AND privilege = '{{ privilege }}' --required +AND endpoint = '{{ endpoint }}' --required +AND deleteMode = '{{ deleteMode }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/grant/grants_to/index.md b/docs/snowflake-docs/providers/snowflake/grant/grants_to/index.md index 02161fbe4..ee6146e9d 100644 --- a/docs/snowflake-docs/providers/snowflake/grant/grants_to/index.md +++ b/docs/snowflake-docs/providers/snowflake/grant/grants_to/index.md @@ -1,4 +1,4 @@ ---- +--- title: grants_to hide_title: false hide_table_of_contents: false @@ -28,53 +28,165 @@ Creates, updates, deletes, gets or lists a grants_to resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | | -| | `boolean` | Can grantee pass this privilege down? | -| | `string` | The role that granted this privilege to this grantee | -| | `string` | Type of role that granted this privilege to this grantee | -| | `string` | Specific name of object being granted to | -| | `string` | Entity type being granted to | -| | `array` | Privilege type | -| | `string` | Name of specific object granted on (not name of privilege!) | -| | `string` | Type of object granted on | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List the roles and privileges granted to the specified grantee using the output of SHOW GRANTS TO | +The following fields are returned by `SELECT` queries: -
+ + +Properties of a grant that can be granted to a role or user. -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe role that granted this privilege to this grantee (example: SUBADMIN)
stringSpecific name of object being granted to (example: ACCOUNTADMIN)
stringName of specific object granted on (not name of privilege!)
string (date-time)
booleanCan grantee pass this privilege down?
stringType of role that granted this privilege to this grantee (example: ROLE)
stringEntity type being granted to (example: ROLE)
arrayPrivilege type
stringType of object granted on (example: ACCOUNT)
+ + + +## Methods -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +The following methods are available for this resource: -
+ + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
granteeType, granteeName, endpointshowLimitList the roles and privileges granted to the specified grantee using the output of SHOW GRANTS TO
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringString that specifies the name of the privilege grantee. (example: SYSADMIN)
stringString that specifies the type of resource that is the privilege grantee. (example: role, enum: [user, role, application-role, database-role, share])
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List the roles and privileges granted to the specified grantee using the output of SHOW GRANTS TO + + +List the roles and privileges granted to the specified grantee using the output of SHOW GRANTS TO ```sql SELECT +granted_by_name, +grantee_name, +securable_name, created_on, grant_option, -granted_by_name, granted_by_role_type, -grantee_name, grantee_type, privileges, -securable_name, securable_type FROM snowflake.grant.grants_to -WHERE granteeName = '{{ granteeName }}' -AND granteeType = '{{ granteeType }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE granteeType = '{{ granteeType }}' -- required +AND granteeName = '{{ granteeName }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/grant/privileges/index.md b/docs/snowflake-docs/providers/snowflake/grant/privileges/index.md index 22011ef12..1209bc169 100644 --- a/docs/snowflake-docs/providers/snowflake/grant/privileges/index.md +++ b/docs/snowflake-docs/providers/snowflake/grant/privileges/index.md @@ -1,4 +1,4 @@ ---- +--- title: privileges hide_title: false hide_table_of_contents: false @@ -28,45 +28,142 @@ Creates, updates, deletes, gets or lists a privileges resource. ## Fields + +The following fields are returned by `SELECT` queries: + `SELECT` not supported for this resource, use `SHOW METHODS` to view available operations for the resource. ## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `INSERT` | | - | Endpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope. | -| | `INSERT` | | - | Endpoint to indicate that the privileges listed in the request body should be granted. | -| | `DELETE` | | | Endpoint to indicate that the privilege listed on the group securable in the given scope should be revoked. | -| | `DELETE` | | | Endpoint to indicate that the privilege listed in the path should be revoked. | -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
granteeType, granteeName, securableType, securableName, endpointEndpoint to indicate that the privileges listed in the request body should be granted.
granteeType, granteeName, bulkGrantType, securableTypePlural, scopeType, scopeName, endpointEndpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope.
granteeType, granteeName, securableType, securableName, privilege, endpointdeleteModeEndpoint to indicate that the privilege listed in the path should be revoked.
granteeType, granteeName, bulkGrantType, securableTypePlural, scopeType, scopeName, privilege, endpointdeleteModeEndpoint to indicate that the privilege listed on the group securable in the given scope should be revoked.
## Parameters -
-Optional Parameter Details +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | If "cascade", recursively revoke the grant from sub-grantees to which this privilege was re-granted. Acceptable values are "restrict" or "cascade". | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringString that species whether this group privilege should be on ALL or FUTURE resources of the specified plural type (example: all, enum: [all, future])
stringOrganization and Account Name (default: orgid-acctid)
stringString that specifies the name of the privilege grantee. (example: SYSADMIN)
stringString that specifies the type of resource that is the privilege grantee. (example: role, enum: [user, role, application-role, database-role, share])
stringString that specifies a privilege to be revoked (example: SELECT)
stringString that specifies the name of resource that is the scope of an ALL/FUTURE privilege (example: MY_DB.MY_SC)
stringString that specifies the type of resource that is the scope of an ALL/FUTURE privilege. Can only be DATABASE or SCHEMA (example: schema, enum: [database, schema])
stringString that specifies the name of resource that is being secured by a privilege. (example: MY_DB)
stringString that specifies the type of resource that is being secured by a privilege. (example: DATABASE)
stringString that specifies the plural of the type of resource that is being secured by an ALL/FUTURE privilege. Must be either "schemas" or any plural object type that can nest under a schema such as "tables" (example: tables)
stringIf "cascade", recursively revoke the grant from sub-grantees to which this privilege was re-granted. Acceptable values are "restrict" or "cascade". (example: restrict)
-
- -## `INSERT` example - -Endpoint to indicate that the privileges listed in the request body should be granted. +## `INSERT` examples - + { label: 'grant_privilege', value: 'grant_privilege' }, + { label: 'grant_group_privilege', value: 'grant_group_privilege' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Endpoint to indicate that the privileges listed in the request body should be granted. ```sql -/*+ create */ INSERT INTO snowflake.grant.privileges ( data__privileges, data__grant_option, @@ -77,10 +174,10 @@ data__securable_type, data__securable_name, data__granted_by_role_type, data__granted_by_name, -granteeName, granteeType, -securableName, +granteeName, securableType, +securableName, endpoint ) SELECT @@ -93,98 +190,176 @@ SELECT '{{ securable_name }}', '{{ granted_by_role_type }}', '{{ granted_by_name }}', -'{{ granteeName }}', '{{ granteeType }}', -'{{ securableName }}', +'{{ granteeName }}', '{{ securableType }}', +'{{ securableName }}', '{{ endpoint }}' ; ``` + - +Endpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope. ```sql -/*+ create */ INSERT INTO snowflake.grant.privileges ( -granteeName, +data__privileges, +data__grant_option, +data__created_on, +data__grantee_type, +data__grantee_name, +data__securable_type, +data__securable_name, +data__granted_by_role_type, +data__granted_by_name, granteeType, -securableName, -securableType, +granteeName, +bulkGrantType, +securableTypePlural, +scopeType, +scopeName, endpoint ) SELECT -'{{ granteeName }}', +'{{ privileges }}', +{{ grant_option }}, +'{{ created_on }}', +'{{ grantee_type }}', +'{{ grantee_name }}', +'{{ securable_type }}', +'{{ securable_name }}', +'{{ granted_by_role_type }}', +'{{ granted_by_name }}', '{{ granteeType }}', -'{{ securableName }}', -'{{ securableType }}', +'{{ granteeName }}', +'{{ bulkGrantType }}', +'{{ securableTypePlural }}', +'{{ scopeType }}', +'{{ scopeName }}', '{{ endpoint }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: privileges props: + - name: granteeType + value: string + description: Required parameter for the privileges resource. - name: granteeName value: string description: Required parameter for the privileges resource. - - name: granteeType + - name: securableType value: string description: Required parameter for the privileges resource. - name: securableName value: string description: Required parameter for the privileges resource. - - name: securableType + - name: endpoint value: string description: Required parameter for the privileges resource. - - name: endpoint + - name: bulkGrantType + value: string + description: Required parameter for the privileges resource. + - name: securableTypePlural + value: string + description: Required parameter for the privileges resource. + - name: scopeType + value: string + description: Required parameter for the privileges resource. + - name: scopeName value: string description: Required parameter for the privileges resource. - name: privileges value: array - description: Privilege type + description: > + Privilege type + - name: grant_option value: boolean - description: Can grantee pass this privilege down? + description: > + Can grantee pass this privilege down? + - name: created_on value: string - name: grantee_type value: string - description: Entity type being granted to + description: > + Entity type being granted to + - name: grantee_name value: string - description: Specific name of object being granted to + description: > + Specific name of object being granted to + - name: securable_type value: string - description: Type of object granted on + description: > + Type of object granted on + - name: securable_name value: string - description: Name of specific object granted on (not name of privilege!) + description: > + Name of specific object granted on (not name of privilege!) + - name: granted_by_role_type value: string - description: Type of role that granted this privilege to this grantee + description: > + Type of role that granted this privilege to this grantee + - name: granted_by_name value: string - description: The role that granted this privilege to this grantee + description: > + The role that granted this privilege to this grantee + ``` -## `DELETE` example + +## `DELETE` examples + + + Endpoint to indicate that the privilege listed in the path should be revoked. ```sql -/*+ delete */ DELETE FROM snowflake.grant.privileges -WHERE granteeName = '{{ granteeName }}' -AND granteeType = '{{ granteeType }}' -AND privilege = '{{ privilege }}' -AND securableName = '{{ securableName }}' -AND securableType = '{{ securableType }}' -AND endpoint = '{{ endpoint }}'; +WHERE granteeType = '{{ granteeType }}' --required +AND granteeName = '{{ granteeName }}' --required +AND securableType = '{{ securableType }}' --required +AND securableName = '{{ securableName }}' --required +AND privilege = '{{ privilege }}' --required +AND endpoint = '{{ endpoint }}' --required +AND deleteMode = '{{ deleteMode }}'; ``` + + + +Endpoint to indicate that the privilege listed on the group securable in the given scope should be revoked. + +```sql +DELETE FROM snowflake.grant.privileges +WHERE granteeType = '{{ granteeType }}' --required +AND granteeName = '{{ granteeName }}' --required +AND bulkGrantType = '{{ bulkGrantType }}' --required +AND securableTypePlural = '{{ securableTypePlural }}' --required +AND scopeType = '{{ scopeType }}' --required +AND scopeName = '{{ scopeName }}' --required +AND privilege = '{{ privilege }}' --required +AND endpoint = '{{ endpoint }}' --required +AND deleteMode = '{{ deleteMode }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/iceberg_table/iceberg_tables/index.md b/docs/snowflake-docs/providers/snowflake/iceberg_table/iceberg_tables/index.md index 084e6d401..de44e389f 100644 --- a/docs/snowflake-docs/providers/snowflake/iceberg_table/iceberg_tables/index.md +++ b/docs/snowflake-docs/providers/snowflake/iceberg_table/iceberg_tables/index.md @@ -1,4 +1,4 @@ ---- +--- title: iceberg_tables hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a iceberg_tables resource. +Creates, updates, deletes, gets or lists an iceberg_tables resource. ## Overview @@ -28,75 +28,523 @@ Creates, updates, deletes, gets or lists a iceberg_tables resource.
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the iceberg table | -| | `boolean` | Specifies whether to automatically refresh the table metadata | -| | `string` | The path to a directory where Snowflake can write data and metadata files for the table. | -| | `string` | Signifies whether Snowflake can write metadata to the location specified by the file_path. | -| | `string` | Name of the catalog integration to use for iceberg tables | -| | `string` | Catalog namespace for the table. The namespace defined when the table was created. Otherwise, the default namespace associated with the catalog integration used by the table. If you’re syncing the table to Snowflake Open Catalog, the default is null. | -| | `string` | Name of the catalog integration to sync this table | -| | `string` | Name of the table as recognized by the catalog. | -| | `boolean` | True if change tracking is enabled, allowing streams and CHANGES to be used on the entity. | -| | `array` | Specifies one or more columns or column expressions in the table as the clustering key. | -| | `array` | | -| | `string` | user comment associated to an object in the dictionary | -| | `array` | | -| | `string` | Date and time when the iceberg table was created. | -| | `integer` | number of days to retain the old version of deleted/updated data | -| | `string` | Database in which the iceberg table is stored | -| | `string` | Name of an external volume that will be used for persisted Iceberg metadata and data files. | -| | `string` | Type of Iceberg table. UNMANAGED if the table is not managed by Snowflake. NOT ICEBERG otherwise. | -| | `integer` | Maximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale. | -| | `string` | Specifies the relative path of the Iceberg metadata file to use for column definitions. | -| | `string` | Role that owns the iceberg table | -| | `string` | The type of role that owns the iceberg table | -| | `boolean` | Specifies whether to replace invalid characters in the column names | -| | `string` | Schema in which the iceberg table is stored | -| | `string` | Storage serialization policy used for managed Iceberg table. This include encodings and compressions | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake iceberg table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the iceberg table (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringName of the table as recognized by the catalog.
stringDatabase in which the iceberg table is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema in which the iceberg table is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether to automatically refresh the table metadata
stringThe path to a directory where Snowflake can write data and metadata files for the table.
stringSignifies whether Snowflake can write metadata to the location specified by the file_path.
stringName of the catalog integration to use for iceberg tables
stringCatalog namespace for the table. The namespace defined when the table was created. Otherwise, the default namespace associated with the catalog integration used by the table. If you’re syncing the table to Snowflake Open Catalog, the default is null.
stringName of the catalog integration to sync this table
booleanTrue if change tracking is enabled, allowing streams and CHANGES to be used on the entity.
arraySpecifies one or more columns or column expressions in the table as the clustering key.
array
stringuser comment associated to an object in the dictionary
array
string (date-time)Date and time when the iceberg table was created.
integernumber of days to retain the old version of deleted/updated data
stringName of an external volume that will be used for persisted Iceberg metadata and data files.
stringType of Iceberg table. UNMANAGED if the table is not managed by Snowflake. NOT ICEBERG otherwise.
integerMaximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale.
stringSpecifies the relative path of the Iceberg metadata file to use for column definitions.
stringRole that owns the iceberg table (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the iceberg table (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether to replace invalid characters in the column names
stringStorage serialization policy used for managed Iceberg table. This include encodings and compressions
+
+ + +A Snowflake iceberg table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the iceberg table (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringName of the table as recognized by the catalog.
stringDatabase in which the iceberg table is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema in which the iceberg table is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether to automatically refresh the table metadata
stringThe path to a directory where Snowflake can write data and metadata files for the table.
stringSignifies whether Snowflake can write metadata to the location specified by the file_path.
stringName of the catalog integration to use for iceberg tables
stringCatalog namespace for the table. The namespace defined when the table was created. Otherwise, the default namespace associated with the catalog integration used by the table. If you’re syncing the table to Snowflake Open Catalog, the default is null.
stringName of the catalog integration to sync this table
booleanTrue if change tracking is enabled, allowing streams and CHANGES to be used on the entity.
arraySpecifies one or more columns or column expressions in the table as the clustering key.
array
stringuser comment associated to an object in the dictionary
array
string (date-time)Date and time when the iceberg table was created.
integernumber of days to retain the old version of deleted/updated data
stringName of an external volume that will be used for persisted Iceberg metadata and data files.
stringType of Iceberg table. UNMANAGED if the table is not managed by Snowflake. NOT ICEBERG otherwise.
integerMaximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale.
stringSpecifies the relative path of the Iceberg metadata file to use for column definitions.
stringRole that owns the iceberg table (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the iceberg table (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether to replace invalid characters in the column names
stringStorage serialization policy used for managed Iceberg table. This include encodings and compressions
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Describe an iceberg table | -| | `SELECT` | | , , , , | Lists the Apache Iceberg™ tables for which you have access privileges. | -| | `INSERT` | | , | Create a snowflake managed iceberg table (clone and undrop are separate subresources) | -| | `DELETE` | | , | Drop an iceberg table | -| | `EXEC` | | , , , | Clone a snowflake managed iceberg table | -| | `EXEC` | | | Convert unmanaged iceberg table to managed iceberg table | -| | `EXEC` | | , | Create a snowflake managed iceberg table as select | -| | `EXEC` | | , , , | Creates a new table with the same column definitions as an existing table, but without copying data from the existing table. | -| | `EXEC` | | | Create an unmanaged iceberg table from AWS Glue catalog | -| | `EXEC` | | | Create an unmanaged iceberg table from Delta | -| | `EXEC` | | | Create an unmanaged iceberg table from Iceberg files | -| | `EXEC` | | | Create an unmanaged iceberg table from Iceberg REST | -| | `EXEC` | | | Refreshes the metadata for an Apache Iceberg table that uses an external Iceberg catalog | -| | `EXEC` | | | Resume recluster of an iceberg table (iceberg tables managed by an external catalog do not allow clustering) | -| | `EXEC` | | | Suspend recluster of an iceberg table (iceberg tables managed by an external catalog do not allow clustering) | -| | `EXEC` | | - | Undrop an iceberg table | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Optionally includes dependency information of the table. | `boolean` | `-` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | -| | Database of the newly created table. Defaults to the source table's database. | `string` | `-` | -| | Schema of the newly created table. Defaults to the source table's schema. | `string` | `-` | -| | Specifies whether the table can be dropped if foreign keys exist that reference the table. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromName, deepLists the Apache Iceberg™ tables for which you have access privileges.
database_name, schema_name, name, endpointDescribe an iceberg table
database_name, schema_name, endpointcreateMode, copyGrantsCreate a snowflake managed iceberg table (clone and undrop are separate subresources)
database_name, schema_name, name, endpointifExists, typeDrop an iceberg table
database_name, schema_name, query, endpointcreateMode, copyGrantsCreate a snowflake managed iceberg table as select
database_name, schema_name, endpointcreateModeCreate an unmanaged iceberg table from AWS Glue catalog
database_name, schema_name, endpointcreateModeCreate an unmanaged iceberg table from Delta
database_name, schema_name, endpointcreateModeCreate an unmanaged iceberg table from Iceberg files
database_name, schema_name, endpointcreateModeCreate an unmanaged iceberg table from Iceberg REST
database_name, schema_name, name, endpointifExistsResume recluster of an iceberg table (iceberg tables managed by an external catalog do not allow clustering)
database_name, schema_name, name, endpointifExistsSuspend recluster of an iceberg table (iceberg tables managed by an external catalog do not allow clustering)
database_name, schema_name, name, endpointifExistsRefreshes the metadata for an Apache Iceberg table that uses an external Iceberg catalog
database_name, schema_name, name, endpointifExistsConvert unmanaged iceberg table to managed iceberg table
database_name, schema_name, name, endpointUndrop an iceberg table
database_name, schema_name, name, endpointcreateMode, copyGrants, targetDatabase, targetSchemaClone a snowflake managed iceberg table
database_name, schema_name, name, endpointcreateMode, copyGrants, targetDatabase, targetSchemaCreates a new table with the same column definitions as an existing table, but without copying data from the existing table.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe SQL select query to run to set up the table values (and possibly columns).
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanOptionally includes dependency information of the table.
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
stringDatabase of the newly created table. Defaults to the source table's database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSchema of the newly created table. Defaults to the source table's schema. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSpecifies whether the table can be dropped if foreign keys exist that reference the table. (enum: [CASCADE, RESTRICT])
## `SELECT` examples @@ -105,8 +553,8 @@ Creates, updates, deletes, gets or lists a iceberg_tables resource. values={[ { label: 'list_iceberg_tables', value: 'list_iceberg_tables' }, { label: 'fetch_iceberg_table', value: 'fetch_iceberg_table' } - ] -}> + ]} +> Lists the Apache Iceberg™ tables for which you have access privileges. @@ -114,13 +562,15 @@ Lists the Apache Iceberg™ tables for which you have access privileges. ```sql SELECT name, +catalog_table_name, +database_name, +schema_name, auto_refresh, base_location, can_write_metadata, catalog, catalog_namespace, catalog_sync, -catalog_table_name, change_tracking, cluster_by, columns, @@ -128,7 +578,6 @@ comment, constraints, created_on, data_retention_time_in_days, -database_name, external_volume, iceberg_table_type, max_data_extension_time_in_days, @@ -136,12 +585,16 @@ metadata_file_path, owner, owner_role_type, replace_invalid_characters, -schema_name, storage_serialization_policy FROM snowflake.iceberg_table.iceberg_tables -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}' +AND deep = '{{ deep }}'; ``` @@ -151,13 +604,15 @@ Describe an iceberg table ```sql SELECT name, +catalog_table_name, +database_name, +schema_name, auto_refresh, base_location, can_write_metadata, catalog, catalog_namespace, catalog_sync, -catalog_table_name, change_tracking, cluster_by, columns, @@ -165,7 +620,6 @@ comment, constraints, created_on, data_retention_time_in_days, -database_name, external_volume, iceberg_table_type, max_data_extension_time_in_days, @@ -173,33 +627,31 @@ metadata_file_path, owner, owner_role_type, replace_invalid_characters, -schema_name, storage_serialization_policy FROM snowflake.iceberg_table.iceberg_tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a snowflake managed iceberg table (clone and undrop are separate subresources) +## `INSERT` examples - + { label: 'create_snowflake_managed_iceberg_table', value: 'create_snowflake_managed_iceberg_table' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a snowflake managed iceberg table (clone and undrop are separate subresources) ```sql -/*+ create */ INSERT INTO snowflake.iceberg_table.iceberg_tables ( data__name, data__comment, @@ -220,7 +672,9 @@ data__metadata_file_path, data__constraints, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -242,34 +696,16 @@ SELECT '{{ constraints }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.iceberg_table.iceberg_tables ( -data__name, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: iceberg_tables props: - name: database_name @@ -283,110 +719,366 @@ SELECT description: Required parameter for the iceberg_tables resource. - name: name value: string - description: >- - Name of the iceberg table (Required parameter for the iceberg_tables - resource.) + description: > + Name of the iceberg table + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + - name: change_tracking value: boolean - description: >- - True if change tracking is enabled, allowing streams and CHANGES to be - used on the entity. + description: > + True if change tracking is enabled, allowing streams and CHANGES to be used on the entity. + - name: max_data_extension_time_in_days value: integer - description: >- - Maximum number of days to extend data retention beyond the retention - period to prevent a stream becoming stale. + description: > + Maximum number of days to extend data retention beyond the retention period to prevent a stream becoming stale. + - name: external_volume value: string - description: >- - Name of an external volume that will be used for persisted Iceberg - metadata and data files. + description: > + Name of an external volume that will be used for persisted Iceberg metadata and data files. + - name: data_retention_time_in_days value: integer - description: number of days to retain the old version of deleted/updated data + description: > + number of days to retain the old version of deleted/updated data + - name: catalog_sync value: string - description: Name of the catalog integration to sync this table + description: > + Name of the catalog integration to sync this table + - name: catalog value: string - description: Name of the catalog integration to use for iceberg tables + description: > + Name of the catalog integration to use for iceberg tables + - name: storage_serialization_policy value: string - description: >- - Storage serialization policy used for managed Iceberg table. This - include encodings and compressions (valid values: 'COMPATIBLE', - 'OPTIMIZED') + description: > + Storage serialization policy used for managed Iceberg table. This include encodings and compressions + + valid_values: ['COMPATIBLE', 'OPTIMIZED'] - name: catalog_table_name value: string - description: Name of the table as recognized by the catalog. + description: > + Name of the table as recognized by the catalog. + - name: catalog_namespace value: string - description: >- - Catalog namespace for the table. The namespace defined when the table - was created. Otherwise, the default namespace associated with the - catalog integration used by the table. If you’re syncing the table to - Snowflake Open Catalog, the default is null. + description: > + Catalog namespace for the table. The namespace defined when the table was created. Otherwise, the default namespace associated with the catalog integration used by the table. If you’re syncing the table to Snowflake Open Catalog, the default is null. + - name: cluster_by value: array - description: >- - Specifies one or more columns or column expressions in the table as the - clustering key. + description: > + Specifies one or more columns or column expressions in the table as the clustering key. + - name: columns - value: - - name: name - value: string - description: Column name - - name: datatype - value: string - description: The data type for the column - - name: comment - value: string - description: Specifies a comment for the column - - name: nullable - value: boolean - description: Argument null return acceptance criteria - - name: default_value - value: string - description: Default value for the column + value: array - name: base_location value: string - description: >- - The path to a directory where Snowflake can write data and metadata - files for the table. + description: > + The path to a directory where Snowflake can write data and metadata files for the table. + - name: replace_invalid_characters value: boolean - description: Specifies whether to replace invalid characters in the column names + description: > + Specifies whether to replace invalid characters in the column names + - name: metadata_file_path value: string - description: >- - Specifies the relative path of the Iceberg metadata file to use for - column definitions. + description: > + Specifies the relative path of the Iceberg metadata file to use for column definitions. + - name: constraints - value: - - name: name - value: string - description: Name of the Constraint - - name: column_names - value: array - - name: constraint_type - value: string - description: Type of the constraint + value: array + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `DELETE` example + +## `DELETE` examples + + + Drop an iceberg table ```sql -/*+ delete */ DELETE FROM snowflake.iceberg_table.iceberg_tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}' +AND type = '{{ type }}'; +``` + + + + +## Lifecycle Methods + + + + +Create a snowflake managed iceberg table as select + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.create_snowflake_managed_iceberg_table_as_select +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@query='{{ query }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }} +@@json= +'{ +"name": "{{ name }}", +"columns": "{{ columns }}", +"external_volume": "{{ external_volume }}", +"cluster_by": "{{ cluster_by }}", +"base_location": "{{ base_location }}", +"comment": "{{ comment }}" +}'; +``` + + + +Create an unmanaged iceberg table from AWS Glue catalog + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.create_unmanaged_iceberg_table_from_aws_glue_catalog +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}' +@@json= +'{ +"name": "{{ name }}", +"external_volume": "{{ external_volume }}", +"catalog_table_name": "{{ catalog_table_name }}", +"catalog_namespace": "{{ catalog_namespace }}", +"replace_invalid_characters": {{ replace_invalid_characters }}, +"auto_refresh": {{ auto_refresh }}, +"catalog": "{{ catalog }}", +"comment": "{{ comment }}" +}'; +``` + + + +Create an unmanaged iceberg table from Delta + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.create_unmanaged_iceberg_table_from_delta +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}' +@@json= +'{ +"name": "{{ name }}", +"external_volume": "{{ external_volume }}", +"replace_invalid_characters": {{ replace_invalid_characters }}, +"base_location": "{{ base_location }}", +"catalog": "{{ catalog }}", +"comment": "{{ comment }}" +}'; +``` + + + +Create an unmanaged iceberg table from Iceberg files + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.create_unmanaged_iceberg_table_from_iceberg_files +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}' +@@json= +'{ +"name": "{{ name }}", +"external_volume": "{{ external_volume }}", +"replace_invalid_characters": {{ replace_invalid_characters }}, +"metadata_file_path": "{{ metadata_file_path }}", +"catalog": "{{ catalog }}", +"comment": "{{ comment }}" +}'; +``` + + + +Create an unmanaged iceberg table from Iceberg REST + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.create_unmanaged_iceberg_table_from_iceberg_rest +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}' +@@json= +'{ +"name": "{{ name }}", +"external_volume": "{{ external_volume }}", +"catalog_table_name": "{{ catalog_table_name }}", +"catalog_namespace": "{{ catalog_namespace }}", +"replace_invalid_characters": {{ replace_invalid_characters }}, +"auto_refresh": {{ auto_refresh }}, +"catalog": "{{ catalog }}", +"comment": "{{ comment }}" +}'; +``` + + + +Resume recluster of an iceberg table (iceberg tables managed by an external catalog do not allow clustering) + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.resume_recluster_iceberg_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; ``` + + + +Suspend recluster of an iceberg table (iceberg tables managed by an external catalog do not allow clustering) + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.suspend_recluster_iceberg_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Refreshes the metadata for an Apache Iceberg table that uses an external Iceberg catalog + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.refresh_iceberg_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }} +@@json= +'{ +"metadata_file_relative_path": "{{ metadata_file_relative_path }}" +}'; +``` + + + +Convert unmanaged iceberg table to managed iceberg table + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.convert_to_managed_iceberg_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }} +@@json= +'{ +"base_location": "{{ base_location }}", +"storage_serialization_policy": "{{ storage_serialization_policy }}" +}'; +``` + + + +Undrop an iceberg table + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.undrop_iceberg_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Clone a snowflake managed iceberg table + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.clone_snowflake_managed_iceberg_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}' +@@json= +'{ +"name": "{{ name }}", +"point_of_time": "{{ point_of_time }}" +}'; +``` + + + +Creates a new table with the same column definitions as an existing table, but without copying data from the existing table. + +```sql +EXEC snowflake.iceberg_table.iceberg_tables.create_snowflake_managed_iceberg_table_like +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}' +@@json= +'{ +"name": "{{ name }}", +"cluster_by": "{{ cluster_by }}", +"external_volume": "{{ external_volume }}", +"base_location": "{{ base_location }}", +"comment": "{{ comment }}" +}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/image_repository/image_repositories/index.md b/docs/snowflake-docs/providers/snowflake/image_repository/image_repositories/index.md index 1b0511ffe..ea36a4b5e 100644 --- a/docs/snowflake-docs/providers/snowflake/image_repository/image_repositories/index.md +++ b/docs/snowflake-docs/providers/snowflake/image_repository/image_repositories/index.md @@ -1,4 +1,4 @@ ---- +--- title: image_repositories hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a image_repositories resource. +Creates, updates, deletes, gets or lists an image_repositories resource. ## Overview @@ -28,37 +28,214 @@ Creates, updates, deletes, gets or lists a image_repositories resou
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Time the image repository was created. | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Identifier for the current owner of the image repository. | -| | `string` | Role type of the image repository owner. | -| | `string` | Current URL of the image repository. | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetches a named image repository in a specified database and schema. | -| | `SELECT` | | | Lists the image repositories under a specified database and schema. | -| | `INSERT` | | | Creates an image repository in the specified database, schema, and create mode. The `createMode` query parameter specifies what action to take based on whether the repository already exists. See the ImageRepository component definition for what is required to be provided in the request body. | -| | `DELETE` | | | Deletes an image repository with the given name. If you enable the `ifExists` query parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist. | +The following fields are returned by `SELECT` queries: + + + + +A Snowflake image repository. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
string (date-time)Time the image repository was created.
stringIdentifier for the current owner of the image repository.
stringRole type of the image repository owner.
stringCurrent URL of the image repository.
+
+ -
+A Snowflake image repository. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
string (date-time)Time the image repository was created.
stringIdentifier for the current owner of the image repository.
stringRole type of the image repository owner.
stringCurrent URL of the image repository.
+
+
+ +## Methods -
-Optional Parameter Details +The following methods are available for this resource: -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlikeLists the image repositories under a specified database and schema.
database_name, schema_name, name, endpointFetches a named image repository in a specified database and schema.
database_name, schema_name, endpointcreateModeCreates an image repository in the specified database, schema, and create mode. The `createMode` query parameter specifies what action to take based on whether the repository already exists. See the ImageRepository component definition for what is required to be provided in the request body.
database_name, schema_name, name, endpointifExistsDeletes an image repository with the given name. If you enable the `ifExists` query parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist.
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -67,8 +244,8 @@ Creates, updates, deletes, gets or lists a image_repositories resou values={[ { label: 'list_image_repositories', value: 'list_image_repositories' }, { label: 'fetch_image_repository', value: 'fetch_image_repository' } - ] -}> + ]} +> Lists the image repositories under a specified database and schema. @@ -76,16 +253,17 @@ Lists the image repositories under a specified database and schema. ```sql SELECT name, -created_on, database_name, +schema_name, +created_on, owner, owner_role_type, -repository_url, -schema_name +repository_url FROM snowflake.image_repository.image_repositories -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -95,77 +273,60 @@ Fetches a named image repository in a specified database and schema. ```sql SELECT name, -created_on, database_name, +schema_name, +created_on, owner, owner_role_type, -repository_url, -schema_name +repository_url FROM snowflake.image_repository.image_repositories -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Creates an image repository in the specified database, schema, and create mode. The `createMode` query parameter specifies what action to take based on whether the repository already exists. See the ImageRepository component definition for what is required to be provided in the request body. +## `INSERT` examples - + { label: 'create_image_repository', value: 'create_image_repository' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Creates an image repository in the specified database, schema, and create mode. The `createMode` query parameter specifies what action to take based on whether the repository already exists. See the ImageRepository component definition for what is required to be provided in the request body. ```sql -/*+ create */ INSERT INTO snowflake.image_repository.image_repositories ( data__name, data__database_name, data__schema_name, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.image_repository.image_repositories ( -data__name, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: image_repositories props: - name: database_name @@ -179,36 +340,46 @@ SELECT description: Required parameter for the image_repositories resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the image_repositories resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: database_name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: schema_name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Deletes an image repository with the given name. If you enable the `ifExists` query parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist. ```sql -/*+ delete */ DELETE FROM snowflake.image_repository.image_repositories -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/image_repository/images/index.md b/docs/snowflake-docs/providers/snowflake/image_repository/images/index.md index fda592faf..b8f5d0822 100644 --- a/docs/snowflake-docs/providers/snowflake/image_repository/images/index.md +++ b/docs/snowflake-docs/providers/snowflake/image_repository/images/index.md @@ -1,4 +1,4 @@ ---- +--- title: images hide_title: false hide_table_of_contents: false @@ -18,7 +18,7 @@ import CopyableCode from '@site/src/components/CopyableCode/CopyableCode'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -Creates, updates, deletes, gets or lists a images resource. +Creates, updates, deletes, gets or lists an images resource. ## Overview @@ -28,36 +28,141 @@ Creates, updates, deletes, gets or lists a images resource.
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Date and time when the image was uploaded to the image repository. | -| | `string` | SHA256 digest of the image. | -| | `string` | Image name. | -| | `string` | Image path (database_name/schema_name/repository_name/image_name:image_tag). | -| | `string` | Image tags. | + +The following fields are returned by `SELECT` queries: + + + + +A image in a Snowflake image repository. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringImage name.
stringDate and time when the image was uploaded to the image repository.
stringSHA256 digest of the image.
stringImage path (database_name/schema_name/repository_name/image_name:image_tag).
stringImage tags.
+
+
## Methods -| Name | Accessible by | Required Params | Description | -|:-----|:--------------|:----------------|:------------| -| | `SELECT` | | List images in the given image repository. | -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, name, endpointList images in the given image repository.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
## `SELECT` examples -List images in the given image repository. + + +List images in the given image repository. ```sql SELECT +image_name, created_on, digest, -image_name, image_path, tags FROM snowflake.image_repository.images -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/managed_account/managed_accounts/index.md b/docs/snowflake-docs/providers/snowflake/managed_account/managed_accounts/index.md index 5722e65a0..08c36c4dc 100644 --- a/docs/snowflake-docs/providers/snowflake/managed_account/managed_accounts/index.md +++ b/docs/snowflake-docs/providers/snowflake/managed_account/managed_accounts/index.md @@ -1,4 +1,4 @@ ---- +--- title: managed_accounts hide_title: false hide_table_of_contents: false @@ -28,50 +28,174 @@ Creates, updates, deletes, gets or lists a managed_accounts resourc ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Account URL that is used to connect to the account, in the legacy account locator format. | -| | `string` | Type of the account. | -| | `string` | Name of the account administrator. | -| | `string` | Password for the account administrator. | -| | `string` | Cloud in which the managed account is located. For reader accounts, this is always the same as the cloud for the provider account. | -| | `string` | Optional comment in which to store information related to the account. | -| | `string` | Date and time the account was created. | -| | `string` | Legacy identifier for the account. | -| | `string` | Region in which the managed account is located. For reader accounts, this is always the same as the region for the provider account. | -| | `string` | Account URL that is used to connect to the account, in the account name format. The account identifier in this format follows the pattern {orgname}-{account_name}. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | Lists the accessible managed accounts. | -| | `INSERT` | | - | Creates a managed account. You must provide the full managed account definition when creating a managed account. | -| | `DELETE` | | - | Removes a managed account, including all objects created in the account, and immediately restricts access to the account. Currently used by data providers to create reader accounts for their consumers. For more details, see Manage reader accounts. | +The following fields are returned by `SELECT` queries: -
+ + +Snowflake account object. -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringName of the account administrator.
stringAccount URL that is used to connect to the account, in the legacy account locator format.
stringType of the account. (default: READER)
string (password)Password for the account administrator.
stringCloud in which the managed account is located. For reader accounts, this is always the same as the cloud for the provider account.
stringOptional comment in which to store information related to the account.
string (date-time)Date and time the account was created.
stringLegacy identifier for the account.
stringRegion in which the managed account is located. For reader accounts, this is always the same as the region for the provider account.
stringAccount URL that is used to connect to the account, in the account name format. The account identifier in this format follows the pattern <orgname>-<account_name>.
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | +## Methods -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlikeLists the accessible managed accounts.
endpointCreates a managed account. You must provide the full managed account definition when creating a managed account.
name, endpointRemoves a managed account, including all objects created in the account, and immediately restricts access to the account. Currently used by data providers to create reader accounts for their consumers. For more details, see Manage reader accounts.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples -Lists the accessible managed accounts. + + +Lists the accessible managed accounts. ```sql SELECT name, +admin_name, account_locator_url, account_type, -admin_name, admin_password, cloud, comment, @@ -80,24 +204,27 @@ locator, region, url FROM snowflake.managed_account.managed_accounts -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` -## `INSERT` example + + -Creates a managed account. You must provide the full managed account definition when creating a managed account. + +## `INSERT` examples - + { label: 'create_managed_account', value: 'create_managed_account' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Creates a managed account. You must provide the full managed account definition when creating a managed account. ```sql -/*+ create */ INSERT INTO snowflake.managed_account.managed_accounts ( data__name, data__comment, @@ -116,32 +243,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.managed_account.managed_accounts ( -data__name, -data__admin_name, -data__admin_password, -data__account_type, -endpoint -) -SELECT -'{{ name }}', -'{{ admin_name }}', -'{{ admin_password }}', -'{{ account_type }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: managed_accounts props: - name: endpoint @@ -149,41 +254,52 @@ SELECT description: Required parameter for the managed_accounts resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the managed_accounts resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: comment value: string - description: Optional comment in which to store information related to the account. + description: > + Optional comment in which to store information related to the account. + - name: admin_name value: string - description: >- - Name of the account administrator. (Required parameter for the - managed_accounts resource.) + description: > + Name of the account administrator. + - name: admin_password value: string - description: >- - Password for the account administrator. (Required parameter for the - managed_accounts resource.) + description: > + Password for the account administrator. + - name: account_type value: string - description: >- - Type of the account. (valid values: 'READER') (Required parameter for - the managed_accounts resource.) + description: > + Type of the account. + + valid_values: ['READER'] default: READER ``` -## `DELETE` example + +## `DELETE` examples + + + Removes a managed account, including all objects created in the account, and immediately restricts access to the account. Currently used by data providers to create reader accounts for their consumers. For more details, see Manage reader accounts. ```sql -/*+ delete */ DELETE FROM snowflake.managed_account.managed_accounts -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/network_policy/network_policies/index.md b/docs/snowflake-docs/providers/snowflake/network_policy/network_policies/index.md index f4987f0fc..f0c2348d1 100644 --- a/docs/snowflake-docs/providers/snowflake/network_policy/network_policies/index.md +++ b/docs/snowflake-docs/providers/snowflake/network_policy/network_policies/index.md @@ -1,4 +1,4 @@ ---- +--- title: network_policies hide_title: false hide_table_of_contents: false @@ -28,38 +28,219 @@ Creates, updates, deletes, gets or lists a network_policies resourc ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the network policy | -| | `array` | List of allowed IPs in a network policy | -| | `array` | List of names of allowed network rules in a network policy | -| | `array` | List of blocked IPs in a network policy | -| | `array` | List of names of blocked network rules in a network policy | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | Date and time when the network policy was created. | -| | `string` | Role that owns the network policy | -| | `string` | The type of role that owns the network policy | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a network policy | -| | `SELECT` | | - | List network policies | -| | `INSERT` | | | Create a network policy | -| | `DELETE` | | | Delete a network policy | +The following fields are returned by `SELECT` queries: + + + + +A Snowflake network policy -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the network policy (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayList of allowed IPs in a network policy
arrayList of names of allowed network rules in a network policy
arrayList of blocked IPs in a network policy
arrayList of names of blocked network rules in a network policy
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the network policy was created.
stringRole that owns the network policy (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the network policy (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
+
+ + +A Snowflake network policy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the network policy (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayList of allowed IPs in a network policy
arrayList of names of allowed network rules in a network policy
arrayList of blocked IPs in a network policy
arrayList of names of blocked network rules in a network policy
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the network policy was created.
stringRole that owns the network policy (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the network policy (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointList network policies
name, endpointFetch a network policy
endpointcreateModeCreate a network policy
name, endpointifExistsDelete a network policy
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
## `SELECT` examples @@ -68,8 +249,8 @@ Creates, updates, deletes, gets or lists a network_policies resourc values={[ { label: 'list_network_policies', value: 'list_network_policies' }, { label: 'fetch_network_policy', value: 'fetch_network_policy' } - ] -}> + ]} +> List network policies @@ -86,7 +267,7 @@ created_on, owner, owner_role_type FROM snowflake.network_policy.network_policies -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required; ``` @@ -105,28 +286,27 @@ created_on, owner, owner_role_type FROM snowflake.network_policy.network_policies -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a network policy +## `INSERT` examples - + { label: 'create_network_policy', value: 'create_network_policy' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a network policy ```sql -/*+ create */ INSERT INTO snowflake.network_policy.network_policies ( data__name, data__allowed_network_rule_list, @@ -134,7 +314,8 @@ data__blocked_network_rule_list, data__allowed_ip_list, data__blocked_ip_list, data__comment, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -143,30 +324,15 @@ SELECT '{{ allowed_ip_list }}', '{{ blocked_ip_list }}', '{{ comment }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.network_policy.network_policies ( -data__name, -endpoint -) -SELECT -'{{ name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: network_policies props: - name: endpoint @@ -174,35 +340,59 @@ SELECT description: Required parameter for the network_policies resource. - name: name value: string - description: >- - Name of the network policy (Required parameter for the network_policies - resource.) + description: > + Name of the network policy + - name: allowed_network_rule_list value: array - description: List of names of allowed network rules in a network policy + description: > + List of names of allowed network rules in a network policy + - name: blocked_network_rule_list value: array - description: List of names of blocked network rules in a network policy + description: > + List of names of blocked network rules in a network policy + - name: allowed_ip_list value: array - description: List of allowed IPs in a network policy + description: > + List of allowed IPs in a network policy + - name: blocked_ip_list value: array - description: List of blocked IPs in a network policy + description: > + List of blocked IPs in a network policy + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a network policy ```sql -/*+ delete */ DELETE FROM snowflake.network_policy.network_policies -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/notebook/notebooks/index.md b/docs/snowflake-docs/providers/snowflake/notebook/notebooks/index.md index 6e842e240..7f32f8aa1 100644 --- a/docs/snowflake-docs/providers/snowflake/notebook/notebooks/index.md +++ b/docs/snowflake-docs/providers/snowflake/notebook/notebooks/index.md @@ -1,4 +1,4 @@ ---- +--- title: notebooks hide_title: false hide_table_of_contents: false @@ -28,69 +28,482 @@ Creates, updates, deletes, gets or lists a notebooks resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the notebook | -| | `string` | Name of the budget if the notebook is monitored by a budget | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | Compute pool name where the snowservice runs | -| | `string` | Date and time when the notebook was created. | -| | `string` | Database in which the notebook is stored | -| | `string` | Default packages of the notebook | -| | `string` | The default version name of a file based entity. | -| | `object` | The version details of a file based entity | -| | `array` | List of external access integrations attached to this function | -| | `string` | Secrets to be used with this function for external access | -| | `string` | Location to copy the file from. This must be a Snowflake stage location. | -| | `integer` | Sets the time in seconds for when to shutdown an idle Notebook. | -| | `array` | List of urls | -| | `object` | The version details of a file based entity | -| | `string` | The current version location | -| | `string` | Name + path of the file for the Notebook | -| | `string` | Role that owns the notebook | -| | `string` | The type of role that owns the notebook | -| | `string` | Warehouse against which the queries issued by the Streamlit app are run against | -| | `string` | The runtime to run the Streamlit or Notebook on. If this is not set, the warehouse is assumed | -| | `string` | Schema in which the notebook is stored | -| | `string` | User facing title of the Streamlit app or an Organization Profile | -| | `string` | Unique ID associated with the notebook object. | -| | `string` | User packages of the notebook | -| | `string` | User specified version alias | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake notebook + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the notebook (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringUnique ID associated with the notebook object.
stringDatabase in which the notebook is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe runtime to run the Streamlit or Notebook on. If this is not set, the warehouse is assumed
stringSchema in which the notebook is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringName of the budget if the notebook is monitored by a budget (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringuser comment associated to an object in the dictionary
stringCompute pool name where the snowservice runs
string (date-time)Date and time when the notebook was created.
stringDefault packages of the notebook
stringThe default version name of a file based entity.
objectThe version details of a file based entity
arrayList of external access integrations attached to this function
stringSecrets to be used with this function for external access
stringLocation to copy the file from. This must be a Snowflake stage location.
integer (int64)Sets the time in seconds for when to shutdown an idle Notebook.
arrayList of urls
objectThe version details of a file based entity
stringThe current version location
stringName + path of the file for the Notebook
stringRole that owns the notebook (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the notebook (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringWarehouse against which the queries issued by the Streamlit app are run against
stringUser facing title of the Streamlit app or an Organization Profile
stringUser packages of the notebook
stringUser specified version alias
+
+ + +A Snowflake notebook + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the notebook (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringUnique ID associated with the notebook object.
stringDatabase in which the notebook is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe runtime to run the Streamlit or Notebook on. If this is not set, the warehouse is assumed
stringSchema in which the notebook is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringName of the budget if the notebook is monitored by a budget (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringuser comment associated to an object in the dictionary
stringCompute pool name where the snowservice runs
string (date-time)Date and time when the notebook was created.
stringDefault packages of the notebook
stringThe default version name of a file based entity.
objectThe version details of a file based entity
arrayList of external access integrations attached to this function
stringSecrets to be used with this function for external access
stringLocation to copy the file from. This must be a Snowflake stage location.
integer (int64)Sets the time in seconds for when to shutdown an idle Notebook.
arrayList of urls
objectThe version details of a file based entity
stringThe current version location
stringName + path of the file for the Notebook
stringRole that owns the notebook (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the notebook (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringWarehouse against which the queries issued by the Streamlit app are run against
stringUser facing title of the Streamlit app or an Organization Profile
stringUser packages of the notebook
stringUser specified version alias
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a notebook | -| | `SELECT` | | , , , | List notebooks | -| | `INSERT` | | | Create a notebook | -| | `DELETE` | | | Delete a notebook | -| | `EXEC` | | , | Adds a LIVE version to the notebook | -| | `EXEC` | | , | If a Git connection is set up for the notebook, commits the LIVE version of the notebook to the Git repository | -| | `EXEC` | | | Execute a Notebook | -| | `EXEC` | | , , | Changes the name of the notebook to new name. The new identifier must be unique for the schema. | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Asynchronous execution enable/disable. Default is disable. | `boolean` | `false` | -| | Sets a comment for the notebook or version of the notebook | `string` | `-` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Sets the LIVE version to the LAST version of the notebook | `boolean` | `-` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | -| | Database of the target resource. Defaults to the source's database | `string` | `-` | -| | Schema of the target resource. Defaults to the source's schema | `string` | `-` | -| | live version of the alias | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromNameList notebooks
database_name, schema_name, name, endpointFetch a notebook
database_name, schema_name, endpointcreateModeCreate a notebook
database_name, schema_name, name, endpointifExistsDelete a notebook
database_name, schema_name, name, endpointasyncExecExecute a Notebook
database_name, schema_name, name, targetName, endpointifExists, targetDatabase, targetSchemaChanges the name of the notebook to new name. The new identifier must be unique for the schema.
database_name, schema_name, name, endpointfromLast, commentAdds a LIVE version to the notebook
database_name, schema_name, name, endpointversion, commentIf a Git connection is set up for the notebook, commits the LIVE version of the notebook to the Git repository
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringName of the target resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanAsynchronous execution enable/disable. Default is disable. (default: false)
stringSets a comment for the notebook or version of the notebook
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanSets the LIVE version to the LAST version of the notebook
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
stringDatabase of the target resource. Defaults to the source's database (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema of the target resource. Defaults to the source's schema (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringlive version of the alias
## `SELECT` examples @@ -99,8 +512,8 @@ Creates, updates, deletes, gets or lists a notebooks resource. values={[ { label: 'list_notebooks', value: 'list_notebooks' }, { label: 'fetch_notebook', value: 'fetch_notebook' } - ] -}> + ]} +> List notebooks @@ -108,11 +521,14 @@ List notebooks ```sql SELECT name, +url_id, +database_name, +runtime_name, +schema_name, budget, comment, compute_pool, created_on, -database_name, default_packages, default_version, default_version_details, @@ -127,16 +543,17 @@ main_file, owner, owner_role_type, query_warehouse, -runtime_name, -schema_name, title, -url_id, user_packages, version FROM snowflake.notebook.notebooks -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` @@ -146,11 +563,14 @@ Fetch a notebook ```sql SELECT name, +url_id, +database_name, +runtime_name, +schema_name, budget, comment, compute_pool, created_on, -database_name, default_packages, default_version, default_version_details, @@ -165,37 +585,33 @@ main_file, owner, owner_role_type, query_warehouse, -runtime_name, -schema_name, title, -url_id, user_packages, version FROM snowflake.notebook.notebooks -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a notebook +## `INSERT` examples - + { label: 'create_notebook', value: 'create_notebook' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a notebook ```sql -/*+ create */ INSERT INTO snowflake.notebook.notebooks ( data__name, data__version, @@ -208,7 +624,8 @@ data__default_version_details, data__last_version_details, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -222,34 +639,15 @@ SELECT '{{ last_version_details }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.notebook.notebooks ( -data__name, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: notebooks props: - name: database_name @@ -263,46 +661,147 @@ SELECT description: Required parameter for the notebooks resource. - name: name value: string - description: Name of the notebook (Required parameter for the notebooks resource.) + description: > + Name of the notebook + - name: version value: string - description: User specified version alias + description: > + User specified version alias + - name: fromLocation value: string - description: Location to copy the file from. This must be a Snowflake stage location. + description: > + Location to copy the file from. This must be a Snowflake stage location. + - name: main_file value: string - description: Name + path of the file for the Notebook + description: > + Name + path of the file for the Notebook + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + - name: default_version value: string - description: The default version name of a file based entity. + description: > + The default version name of a file based entity. + - name: query_warehouse value: string - description: >- - Warehouse against which the queries issued by the Streamlit app are run - against + description: > + Warehouse against which the queries issued by the Streamlit app are run against + - name: default_version_details - value: {} - description: The version details of a file based entity + value: object + description: > + The version details of a file based entity + - name: last_version_details - value: {} - description: The version details of a file based entity + value: object + description: > + The version details of a file based entity + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a notebook ```sql -/*+ delete */ DELETE FROM snowflake.notebook.notebooks -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Execute a Notebook + +```sql +EXEC snowflake.notebook.notebooks.execute_notebook +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@asyncExec={{ asyncExec }}; +``` + + + +Changes the name of the notebook to new name. The new identifier must be unique for the schema. + +```sql +EXEC snowflake.notebook.notebooks.rename_notebook +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetName='{{ targetName }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}'; +``` + + + +Adds a LIVE version to the notebook + +```sql +EXEC snowflake.notebook.notebooks.add_live_version_notebook +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@fromLast={{ fromLast }}, +@comment='{{ comment }}'; ``` + + + +If a Git connection is set up for the notebook, commits the LIVE version of the notebook to the Git repository + +```sql +EXEC snowflake.notebook.notebooks.commit_notebook +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@version='{{ version }}', +@comment='{{ comment }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/notification_integration/notification_integrations/index.md b/docs/snowflake-docs/providers/snowflake/notification_integration/notification_integrations/index.md index d612a519c..b5e4cca2e 100644 --- a/docs/snowflake-docs/providers/snowflake/notification_integration/notification_integrations/index.md +++ b/docs/snowflake-docs/providers/snowflake/notification_integration/notification_integrations/index.md @@ -1,4 +1,4 @@ ---- +--- title: notification_integrations hide_title: false hide_table_of_contents: false @@ -28,35 +28,184 @@ Creates, updates, deletes, gets or lists a notification_integrations ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the notification. | -| | `string` | Comment for the notification integration. | -| | `string` | Date and time when the notification was created. | -| | `boolean` | Whether the notification integration is enabled. | -| | `object` | | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a notification integration | -| | `SELECT` | | | List notification integrations | -| | `INSERT` | | | Create a notification integration | -| | `DELETE` | | | Delete a notification integration | +The following fields are returned by `SELECT` queries: + + + + +A Snowflake notification + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the notification. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringComment for the notification integration.
string (date-time)Date and time when the notification was created.
booleanWhether the notification integration is enabled.
object
+
+ + +A Snowflake notification -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the notification. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringComment for the notification integration.
string (date-time)Date and time when the notification was created.
booleanWhether the notification integration is enabled.
object
+
+
+## Methods -
-Optional Parameter Details +The following methods are available for this resource: -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlikeList notification integrations
name, endpointFetch a notification integration
endpointcreateModeCreate a notification integration
name, endpointifExistsDelete a notification integration
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -65,8 +214,8 @@ Creates, updates, deletes, gets or lists a notification_integrations + ]} +> List notification integrations @@ -79,7 +228,8 @@ created_on, enabled, notification_hook FROM snowflake.notification_integration.notification_integrations -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -94,66 +244,49 @@ created_on, enabled, notification_hook FROM snowflake.notification_integration.notification_integrations -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a notification integration +## `INSERT` examples - + { label: 'create_notification_integration', value: 'create_notification_integration' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a notification integration ```sql -/*+ create */ INSERT INTO snowflake.notification_integration.notification_integrations ( data__name, data__enabled, data__comment, data__notification_hook, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', {{ enabled }}, '{{ comment }}', '{{ notification_hook }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.notification_integration.notification_integrations ( -data__name, -data__notification_hook, -endpoint -) -SELECT -'{{ name }}', -'{{ notification_hook }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: notification_integrations props: - name: endpoint @@ -161,30 +294,46 @@ SELECT description: Required parameter for the notification_integrations resource. - name: name value: string - description: >- - Name of the notification. (Required parameter for the - notification_integrations resource.) + description: > + Name of the notification. + - name: enabled value: boolean - description: Whether the notification integration is enabled. + description: > + Whether the notification integration is enabled. + - name: comment value: string - description: Comment for the notification integration. + description: > + Comment for the notification integration. + - name: notification_hook - value: - type: string - description: Required parameter for the notification_integrations resource. + value: object + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a notification integration ```sql -/*+ delete */ DELETE FROM snowflake.notification_integration.notification_integrations -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/pipe/pipes/index.md b/docs/snowflake-docs/providers/snowflake/pipe/pipes/index.md index d2f67ed43..3341ee5cb 100644 --- a/docs/snowflake-docs/providers/snowflake/pipe/pipes/index.md +++ b/docs/snowflake-docs/providers/snowflake/pipe/pipes/index.md @@ -1,4 +1,4 @@ ---- +--- title: pipes hide_title: false hide_table_of_contents: false @@ -28,48 +28,311 @@ Creates, updates, deletes, gets or lists a pipes resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the pipe | -| | `boolean` | TRUE if all files from stage need to be auto-ingested | -| | `string` | Optional, if provided, auto_ingest pipe will only receive messages from this SNS topic. | -| | `string` | Name of the budget if the pipe is monitored by a budget | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | COPY INTO statement used to load data from queued files into a Snowflake table. This statement serves as the text/definition for the pipe and is displayed in the SHOW PIPES output | -| | `string` | Date and time when the pipe was created. | -| | `string` | Database in which the pipe is stored | -| | `string` | Link to integration object that point to a user provided Azure storage queue / SQS. When present, errors (e.g. ingest failure for Snowpipe or a user task failure or replication failure) will be sent to this queue to notify customers | -| | `string` | Link to integration object that ties a user provided storage queue to an auto_ingest enabled pipe. Required for auto_ingest to work on azure. | -| | `string` | Displays some detailed information for your pipes that may have issues | -| | `string` | Role that owns the pipe | -| | `string` | The type of role that owns the pipe | -| | `string` | PATTERN copy option value in the COPY INTO statement in the pipe definition, if the copy option was specified. | -| | `string` | Schema in which the pipe is stored | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a pipe | -| | `SELECT` | | | List pipes | -| | `INSERT` | | | Create a pipe | -| | `DELETE` | | | Delete a pipe | -| | `EXEC` | | , , | Refresh the pipe | +The following fields are returned by `SELECT` queries: + + + + +A Snowflake pipe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the pipe
stringDatabase in which the pipe is stored
stringSchema in which the pipe is stored
booleanTRUE if all files from stage need to be auto-ingested
stringOptional, if provided, auto_ingest pipe will only receive messages from this SNS topic.
stringName of the budget if the pipe is monitored by a budget
stringuser comment associated to an object in the dictionary
stringCOPY INTO <table> statement used to load data from queued files into a Snowflake table. This statement serves as the text/definition for the pipe and is displayed in the SHOW PIPES output (pattern: (?i)^COPY INTO .*)
string (date-time)Date and time when the pipe was created.
stringLink to integration object that point to a user provided Azure storage queue / SQS. When present, errors (e.g. ingest failure for Snowpipe or a user task failure or replication failure) will be sent to this queue to notify customers
stringLink to integration object that ties a user provided storage queue to an auto_ingest enabled pipe. Required for auto_ingest to work on azure.
stringDisplays some detailed information for your pipes that may have issues
stringRole that owns the pipe
stringThe type of role that owns the pipe
stringPATTERN copy option value in the COPY INTO <table> statement in the pipe definition, if the copy option was specified.
+
+ + +A Snowflake pipe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the pipe
stringDatabase in which the pipe is stored
stringSchema in which the pipe is stored
booleanTRUE if all files from stage need to be auto-ingested
stringOptional, if provided, auto_ingest pipe will only receive messages from this SNS topic.
stringName of the budget if the pipe is monitored by a budget
stringuser comment associated to an object in the dictionary
stringCOPY INTO <table> statement used to load data from queued files into a Snowflake table. This statement serves as the text/definition for the pipe and is displayed in the SHOW PIPES output (pattern: (?i)^COPY INTO .*)
string (date-time)Date and time when the pipe was created.
stringLink to integration object that point to a user provided Azure storage queue / SQS. When present, errors (e.g. ingest failure for Snowpipe or a user task failure or replication failure) will be sent to this queue to notify customers
stringLink to integration object that ties a user provided storage queue to an auto_ingest enabled pipe. Required for auto_ingest to work on azure.
stringDisplays some detailed information for your pipes that may have issues
stringRole that owns the pipe
stringThe type of role that owns the pipe
stringPATTERN copy option value in the COPY INTO <table> statement in the pipe definition, if the copy option was specified.
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlikeList pipes
database_name, schema_name, name, endpointFetch a pipe
database_name, schema_name, endpointcreateModeCreate a pipe
database_name, schema_name, name, endpointifExistsDelete a pipe
database_name, schema_name, name, endpointifExists, prefix, modified_afterRefresh the pipe
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Timestamp (in ISO-8601 format) of the oldest data files to copy into the Snowpipe ingest queue based on the LAST_MODIFIED date (i.e. date when a file was staged) | `string` | `-` | -| | Path (or prefix) appended to the stage reference in the pipe definition. The path limits the set of files to load. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
string (date-time)Timestamp (in ISO-8601 format) of the oldest data files to copy into the Snowpipe ingest queue based on the LAST_MODIFIED date (i.e. date when a file was staged)
stringPath (or prefix) appended to the stage reference in the pipe definition. The path limits the set of files to load.
## `SELECT` examples @@ -78,8 +341,8 @@ Creates, updates, deletes, gets or lists a pipes resource. values={[ { label: 'list_pipes', value: 'list_pipes' }, { label: 'fetch_pipe', value: 'fetch_pipe' } - ] -}> + ]} +> List pipes @@ -87,24 +350,25 @@ List pipes ```sql SELECT name, +database_name, +schema_name, auto_ingest, aws_sns_topic, budget, comment, copy_statement, created_on, -database_name, error_integration, integration, invalid_reason, owner, owner_role_type, -pattern, -schema_name +pattern FROM snowflake.pipe.pipes -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -114,45 +378,44 @@ Fetch a pipe ```sql SELECT name, +database_name, +schema_name, auto_ingest, aws_sns_topic, budget, comment, copy_statement, created_on, -database_name, error_integration, integration, invalid_reason, owner, owner_role_type, -pattern, -schema_name +pattern FROM snowflake.pipe.pipes -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a pipe +## `INSERT` examples - + { label: 'create_pipe', value: 'create_pipe' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a pipe ```sql -/*+ create */ INSERT INTO snowflake.pipe.pipes ( data__name, data__comment, @@ -163,7 +426,8 @@ data__integration, data__copy_statement, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -175,36 +439,15 @@ SELECT '{{ copy_statement }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.pipe.pipes ( -data__name, -data__copy_statement, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ copy_statement }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: pipes props: - name: database_name @@ -218,50 +461,92 @@ SELECT description: Required parameter for the pipes resource. - name: name value: string - description: Name of the pipe (Required parameter for the pipes resource.) + description: > + Name of the pipe + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + - name: auto_ingest value: boolean - description: TRUE if all files from stage need to be auto-ingested + description: > + TRUE if all files from stage need to be auto-ingested + - name: error_integration value: string - description: >- - Link to integration object that point to a user provided Azure storage - queue / SQS. When present, errors (e.g. ingest failure for Snowpipe or a - user task failure or replication failure) will be sent to this queue to - notify customers + description: > + Link to integration object that point to a user provided Azure storage queue / SQS. When present, errors (e.g. ingest failure for Snowpipe or a user task failure or replication failure) will be sent to this queue to notify customers + - name: aws_sns_topic value: string - description: >- - Optional, if provided, auto_ingest pipe will only receive messages from - this SNS topic. + description: > + Optional, if provided, auto_ingest pipe will only receive messages from this SNS topic. + - name: integration value: string - description: >- - Link to integration object that ties a user provided storage queue to an - auto_ingest enabled pipe. Required for auto_ingest to work on azure. + description: > + Link to integration object that ties a user provided storage queue to an auto_ingest enabled pipe. Required for auto_ingest to work on azure. + - name: copy_statement value: string - description: >- - COPY INTO statement used to load data from queued files into a Snowflake - table. This statement serves as the text/definition for the pipe and is - displayed in the SHOW PIPES output (Required parameter for the pipes - resource.) + description: > + COPY INTO statement used to load data from queued files into a Snowflake table. This statement serves as the text/definition for the pipe and is displayed in the SHOW PIPES output + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a pipe ```sql -/*+ delete */ DELETE FROM snowflake.pipe.pipes -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + + + +## Lifecycle Methods + + + + +Refresh the pipe + +```sql +EXEC snowflake.pipe.pipes.refresh_pipe +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}, +@prefix='{{ prefix }}', +@modified_after='{{ modified_after }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/procedure/procedures/index.md b/docs/snowflake-docs/providers/snowflake/procedure/procedures/index.md index 9dc00fef6..e898d4368 100644 --- a/docs/snowflake-docs/providers/snowflake/procedure/procedures/index.md +++ b/docs/snowflake-docs/providers/snowflake/procedure/procedures/index.md @@ -1,4 +1,4 @@ ---- +--- title: procedures hide_title: false hide_table_of_contents: false @@ -28,48 +28,316 @@ Creates, updates, deletes, gets or lists a procedures resource.
## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the procedure | -| | `array` | List of arguments for the function/procedure | -| | `string` | Function/procedure definition | -| | `string` | Specifies a comment for the function/procedure | -| | `string` | The date and time when the function/procedure was created | -| | `string` | The name of the database in which the function/procedure exists. | -| | `string` | What permissions should the procedure execution be called with | -| | `boolean` | If the function/procedure is built-in or not (user-defined) | -| | `boolean` | Specifies whether the function/procedure is secure or not | -| | `object` | | -| | `integer` | The maximum number of arguments | -| | `integer` | The minimum number of arguments | -| | `string` | Role that owns the function/procedure | -| | `string` | The type of role that owns the function/procedure | -| | `object` | | -| | `string` | The name of the schema in which the function/procedure exists. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a procedure | -| | `SELECT` | | | List procedures | -| | `INSERT` | | , | Create a procedure | -| | `DELETE` | | | Delete a procedure | -| | `EXEC` | | - | Call a procedure | +The following fields are returned by `SELECT` queries: + + + -
+A Snowflake procedure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the procedure (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the database in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the schema in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayList of arguments for the function/procedure
stringFunction/procedure definition
stringSpecifies a comment for the function/procedure
string (date-time)The date and time when the function/procedure was created
stringWhat permissions should the procedure execution be called with
booleanIf the function/procedure is built-in or not (user-defined)
booleanSpecifies whether the function/procedure is secure or not
object
integerThe maximum number of arguments
integerThe minimum number of arguments
stringRole that owns the function/procedure
stringThe type of role that owns the function/procedure
object
+
+ + +A Snowflake procedure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the procedure (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the database in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the schema in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayList of arguments for the function/procedure
stringFunction/procedure definition
stringSpecifies a comment for the function/procedure
string (date-time)The date and time when the function/procedure was created
stringWhat permissions should the procedure execution be called with
booleanIf the function/procedure is built-in or not (user-defined)
booleanSpecifies whether the function/procedure is secure or not
object
integerThe maximum number of arguments
integerThe minimum number of arguments
stringRole that owns the function/procedure
stringThe type of role that owns the function/procedure
object
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlikeList procedures
database_name, schema_name, nameWithArgs, endpointFetch a procedure
database_name, schema_name, endpointcreateMode, copyGrantsCreate a procedure
database_name, schema_name, nameWithArgs, endpointifExistsDelete a procedure
database_name, schema_name, nameWithArgs, endpointCall a procedure
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringFunction's name with Args (example: foo(a number, b number))
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -78,8 +346,8 @@ Creates, updates, deletes, gets or lists a procedures resource. values={[ { label: 'list_procedures', value: 'list_procedures' }, { label: 'fetch_procedure', value: 'fetch_procedure' } - ] -}> + ]} +> List procedures @@ -87,11 +355,12 @@ List procedures ```sql SELECT name, +database_name, +schema_name, arguments, body, comment, created_on, -database_name, execute_as, is_builtin, is_secure, @@ -100,12 +369,12 @@ max_num_arguments, min_num_arguments, owner, owner_role_type, -return_type, -schema_name +return_type FROM snowflake.procedure.procedures -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -115,11 +384,12 @@ Fetch a procedure ```sql SELECT name, +database_name, +schema_name, arguments, body, comment, created_on, -database_name, execute_as, is_builtin, is_secure, @@ -128,33 +398,31 @@ max_num_arguments, min_num_arguments, owner, owner_role_type, -return_type, -schema_name +return_type FROM snowflake.procedure.procedures -WHERE database_name = '{{ database_name }}' -AND nameWithArgs = '{{ nameWithArgs }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND nameWithArgs = '{{ nameWithArgs }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a procedure +## `INSERT` examples - + { label: 'create_procedure', value: 'create_procedure' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a procedure ```sql -/*+ create */ INSERT INTO snowflake.procedure.procedures ( data__name, data__execute_as, @@ -166,7 +434,9 @@ data__comment, data__body, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -179,42 +449,16 @@ SELECT '{{ body }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.procedure.procedures ( -data__name, -data__arguments, -data__return_type, -data__language_config, -data__body, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ arguments }}', -'{{ return_type }}', -'{{ language_config }}', -'{{ body }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: procedures props: - name: database_name @@ -228,66 +472,96 @@ SELECT description: Required parameter for the procedures resource. - name: name value: string - description: Name of the procedure (Required parameter for the procedures resource.) + description: > + Name of the procedure + - name: execute_as value: string - description: >- - What permissions should the procedure execution be called with (valid - values: 'CALLER', 'OWNER') + description: > + What permissions should the procedure execution be called with + + valid_values: ['CALLER', 'OWNER'] - name: is_secure value: boolean - description: Specifies whether the function/procedure is secure or not + description: > + Specifies whether the function/procedure is secure or not + - name: arguments - value: - - name: name - value: string - description: Argument name - - name: datatype - value: string - description: >- - Argument data type (valid values: 'ARRAY', 'BIGINT', 'BINARY', - 'BOOLEAN', 'BYTEINT', 'CHAR', 'CHARACTER', 'DATE', 'DATETIME', - 'DECIMAL', 'DOUBLE', 'DOUBLE PRECISION', 'FLOAT', 'FLOAT4', - 'FLOAT8', 'GEOGRAPHY', 'GEOMETRY', 'INT', 'INTEGER', 'NUMBER', - 'NUMERIC', 'OBJECT', 'REAL', 'STRING', 'SMALLINT', 'TEXT', 'TIME', - 'TIMESTAMP_LTZ', 'TIMESTAMP_NTZ', 'TIMESTAMP_TZ', 'TINYINT', - 'VARBINARY', 'VARCHAR', 'VARIANT', 'VECTOR') - - name: default_value - value: string - description: Default value of the argument - description: >- - List of arguments for the function/procedure (Required parameter for the - procedures resource.) + value: array + description: > + List of arguments for the function/procedure + - name: return_type - value: - type: string - description: Required parameter for the procedures resource. + value: object - name: language_config - value: - language: string - called_on_null_input: boolean - description: Required parameter for the procedures resource. + value: object - name: comment value: string - description: Specifies a comment for the function/procedure + description: > + Specifies a comment for the function/procedure + - name: body value: string - description: >- - Function/procedure definition (Required parameter for the procedures - resource.) + description: > + Function/procedure definition + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a procedure ```sql -/*+ delete */ DELETE FROM snowflake.procedure.procedures -WHERE database_name = '{{ database_name }}' -AND nameWithArgs = '{{ nameWithArgs }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND nameWithArgs = '{{ nameWithArgs }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Call a procedure + +```sql +EXEC snowflake.procedure.procedures.call_procedure +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@nameWithArgs='{{ nameWithArgs }}' --required, +@endpoint='{{ endpoint }}' --required +@@json= +'{ +"call_arguments": "{{ call_arguments }}" +}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/result/results/index.md b/docs/snowflake-docs/providers/snowflake/result/results/index.md index a67b973f6..48aca9577 100644 --- a/docs/snowflake-docs/providers/snowflake/result/results/index.md +++ b/docs/snowflake-docs/providers/snowflake/result/results/index.md @@ -1,4 +1,4 @@ ---- +--- title: results hide_title: false hide_table_of_contents: false @@ -28,22 +28,83 @@ Creates, updates, deletes, gets or lists a results resource. ## Fields + +The following fields are returned by `SELECT` queries: + `SELECT` not supported for this resource, use `SHOW METHODS` to view available operations for the resource. ## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `EXEC` | | | Get result status or the result when it is ready. | -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
result_handler, endpointpageGet result status or the result when it is ready.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringThe opaque result id.
integer (int64)Number of the page of results to return. The number can range from 0 to the total number of pages minus 1. (minimum: 0, default: 0)
+## Lifecycle Methods -
-Optional Parameter Details + + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Number of the page of results to return. The number can range from 0 to the total number of pages minus 1. | `integer` | `0` | +Get result status or the result when it is ready. -
+```sql +EXEC snowflake.result.results.fetch_result +@result_handler='{{ result_handler }}' --required, +@endpoint='{{ endpoint }}' --required, +@page='{{ page }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/role/future_grants/index.md b/docs/snowflake-docs/providers/snowflake/role/future_grants/index.md index 1b01d8544..141816961 100644 --- a/docs/snowflake-docs/providers/snowflake/role/future_grants/index.md +++ b/docs/snowflake-docs/providers/snowflake/role/future_grants/index.md @@ -1,4 +1,4 @@ ---- +--- title: future_grants hide_title: false hide_table_of_contents: false @@ -28,40 +28,152 @@ Creates, updates, deletes, gets or lists a future_grants resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `object` | | -| | `string` | Date and time when the grant was created | -| | `boolean` | If true, allows the recipient role to grant the privileges to other roles. | -| | `string` | The role that granted this privilege to this grantee | -| | `array` | List of privileges to be granted. | -| | `object` | | -| | `string` | Type of the securable to be granted. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all future grants to the role | -| | `INSERT` | | - | Grant future privileges to the role | -| | `DELETE` | | | Revoke future grants from the role | +The following fields are returned by `SELECT` queries: -
+ + +successful -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
object
string (date-time)Date and time when the grant was created
booleanIf true, allows the recipient role to grant the privileges to other roles.
stringThe role that granted this privilege to this grantee
arrayList of privileges to be granted.
object
stringType of the securable to be granted.
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
name, endpointshowLimitList all future grants to the role
name, endpointGrant future privileges to the role
name, endpointmodeRevoke future grants from the role
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. (enum: [restrict, cascade], example: restrict)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all future grants to the role + + +List all future grants to the role ```sql SELECT @@ -73,25 +185,28 @@ privileges, securable, securable_type FROM snowflake.role.future_grants -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; ``` -## `INSERT` example + + -Grant future privileges to the role + +## `INSERT` examples - + { label: 'grant_future_privileges', value: 'grant_future_privileges' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Grant future privileges to the role ```sql -/*+ create */ INSERT INTO snowflake.role.future_grants ( data__securable, data__containing_scope, @@ -112,28 +227,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.role.future_grants ( -data__securable_type, -name, -endpoint -) -SELECT -'{{ securable_type }}', -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: future_grants props: - name: name @@ -143,40 +240,46 @@ SELECT value: string description: Required parameter for the future_grants resource. - name: securable - value: - database: string - schema: string - service: string - name: string + value: object - name: containing_scope - value: - database: string - schema: string + value: object - name: securable_type value: string - description: >- - Type of the securable to be granted. (Required parameter for the - future_grants resource.) + description: > + Type of the securable to be granted. + - name: grant_option value: boolean - description: >- - If true, allows the recipient role to grant the privileges to other - roles. + description: > + If true, allows the recipient role to grant the privileges to other roles. + - name: privileges value: array - description: List of privileges to be granted. + description: > + List of privileges to be granted. + ``` -## `DELETE` example + +## `DELETE` examples + + + Revoke future grants from the role ```sql -/*+ delete */ DELETE FROM snowflake.role.future_grants -WHERE name = '{{ name }}' -AND data__securable_type = '{{ data__securable_type }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND mode = '{{ mode }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/role/grants/index.md b/docs/snowflake-docs/providers/snowflake/role/grants/index.md index 7bd2c70d1..d71f146f8 100644 --- a/docs/snowflake-docs/providers/snowflake/role/grants/index.md +++ b/docs/snowflake-docs/providers/snowflake/role/grants/index.md @@ -1,4 +1,4 @@ ---- +--- title: grants hide_title: false hide_table_of_contents: false @@ -28,40 +28,152 @@ Creates, updates, deletes, gets or lists a grants resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `object` | | -| | `string` | Date and time when the grant was created | -| | `boolean` | If true, allows the recipient role to grant the privileges to other roles. | -| | `string` | The role that granted this privilege to this grantee | -| | `array` | List of privileges to be granted. | -| | `object` | | -| | `string` | Type of the securable to be granted. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all grants to the role | -| | `INSERT` | | - | Grant privileges to the role | -| | `DELETE` | | | Revoke grants from the role | +The following fields are returned by `SELECT` queries: -
+ + +successful -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
object
string (date-time)Date and time when the grant was created
booleanIf true, allows the recipient role to grant the privileges to other roles.
stringThe role that granted this privilege to this grantee
arrayList of privileges to be granted.
object
stringType of the securable to be granted.
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
name, endpointshowLimitList all grants to the role
name, endpointGrant privileges to the role
name, endpointmodeRevoke grants from the role
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter determines whether the revoke operation succeeds or fails for the privileges, based on the whether the privileges had been re-granted to another role. - restrict: If the privilege being revoked has been re-granted to another role, the REVOKE command fails. - cascade: If the privilege being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants. If the same privilege on an object has been granted to the target role by a different grantor (parallel grant), that grant is not affected and the target role retains the privilege. (enum: [restrict, cascade], example: restrict)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all grants to the role + + +List all grants to the role ```sql SELECT @@ -73,25 +185,28 @@ privileges, securable, securable_type FROM snowflake.role.grants -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; ``` -## `INSERT` example + + -Grant privileges to the role + +## `INSERT` examples - + { label: 'grant_privileges', value: 'grant_privileges' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Grant privileges to the role ```sql -/*+ create */ INSERT INTO snowflake.role.grants ( data__securable, data__containing_scope, @@ -112,28 +227,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.role.grants ( -data__securable_type, -name, -endpoint -) -SELECT -'{{ securable_type }}', -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: grants props: - name: name @@ -143,40 +240,46 @@ SELECT value: string description: Required parameter for the grants resource. - name: securable - value: - database: string - schema: string - service: string - name: string + value: object - name: containing_scope - value: - database: string - schema: string + value: object - name: securable_type value: string - description: >- - Type of the securable to be granted. (Required parameter for the grants - resource.) + description: > + Type of the securable to be granted. + - name: grant_option value: boolean - description: >- - If true, allows the recipient role to grant the privileges to other - roles. + description: > + If true, allows the recipient role to grant the privileges to other roles. + - name: privileges value: array - description: List of privileges to be granted. + description: > + List of privileges to be granted. + ``` -## `DELETE` example + +## `DELETE` examples + + + Revoke grants from the role ```sql -/*+ delete */ DELETE FROM snowflake.role.grants -WHERE name = '{{ name }}' -AND data__securable_type = '{{ data__securable_type }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND mode = '{{ mode }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/role/grants_of/index.md b/docs/snowflake-docs/providers/snowflake/role/grants_of/index.md index 2a1ed5962..850129d77 100644 --- a/docs/snowflake-docs/providers/snowflake/role/grants_of/index.md +++ b/docs/snowflake-docs/providers/snowflake/role/grants_of/index.md @@ -1,4 +1,4 @@ ---- +--- title: grants_of hide_title: false hide_table_of_contents: false @@ -28,44 +28,135 @@ Creates, updates, deletes, gets or lists a grants_of resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Date and time when the grant was created | -| | `string` | The role that granted this role to this grantee | -| | `string` | The type of the grantee, can be USER or ROLE | -| | `string` | The name of the grantee | -| | `string` | The name of the role | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all grants of the role | +The following fields are returned by `SELECT` queries: + + + + +successful + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe name of the grantee
string (date-time)Date and time when the grant was created
stringThe role that granted this role to this grantee
stringThe type of the grantee, can be USER or ROLE
stringThe name of the role
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
name, endpointshowLimitList all grants of the role
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all grants of the role + + +List all grants of the role ```sql SELECT +grantee_name, created_on, granted_by, granted_to, -grantee_name, role FROM snowflake.role.grants_of -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/role/grants_on/index.md b/docs/snowflake-docs/providers/snowflake/role/grants_on/index.md index ff71a0322..fbde3b896 100644 --- a/docs/snowflake-docs/providers/snowflake/role/grants_on/index.md +++ b/docs/snowflake-docs/providers/snowflake/role/grants_on/index.md @@ -1,4 +1,4 @@ ---- +--- title: grants_on hide_title: false hide_table_of_contents: false @@ -28,52 +28,159 @@ Creates, updates, deletes, gets or lists a grants_on resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | The name of the role | -| | `string` | Date and time when the grant was created | -| | `string` | If true, allows the recipient role to grant the privileges to other roles. | -| | `string` | The role that granted this privilege to this grantee | -| | `string` | Type of the role that granted this privilege to this grantee | -| | `string` | The type of of the role | -| | `string` | The type of the grantee | -| | `string` | The name of the grantee | -| | `string` | The name of the privilege | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all grants on the role | +The following fields are returned by `SELECT` queries: + + + + +successful + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe name of the role
stringThe name of the grantee
string (date-time)Date and time when the grant was created
stringIf true, allows the recipient role to grant the privileges to other roles.
stringThe role that granted this privilege to this grantee
stringType of the role that granted this privilege to this grantee
stringThe type of of the role
stringThe type of the grantee
stringThe name of the privilege
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
name, endpointshowLimitList all grants on the role
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all grants on the role + + +List all grants on the role ```sql SELECT name, +grantee_name, created_on, grant_option, granted_by, granted_by_role_type, granted_on, granted_to, -grantee_name, privilege FROM snowflake.role.grants_on -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/role/roles/index.md b/docs/snowflake-docs/providers/snowflake/role/roles/index.md index 763ab83a3..b3031de5a 100644 --- a/docs/snowflake-docs/providers/snowflake/role/roles/index.md +++ b/docs/snowflake-docs/providers/snowflake/role/roles/index.md @@ -1,4 +1,4 @@ ---- +--- title: roles hide_title: false hide_table_of_contents: false @@ -28,47 +28,187 @@ Creates, updates, deletes, gets or lists a roles resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the role. | -| | `integer` | The number of users to whom this role has been assigned. | -| | `string` | Comment of the role. | -| | `string` | Date and time when the role was created. | -| | `integer` | The number of roles that have been granted to this role. | -| | `integer` | The number of roles to which this role has been granted. | -| | `boolean` | Specifies whether the role being fetched is the user's current role. | -| | `boolean` | Specifies whether the role being fetched is the user's default role. | -| | `boolean` | Specifies whether the role used to run the command inherits the specified role. | -| | `string` | Specifies the role that owns this role. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | , , , | List roles | -| | `INSERT` | | | Create a role | -| | `DELETE` | | | Delete a role | +The following fields are returned by `SELECT` queries: + + + -
+A Snowflake role + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the role. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
integer (int64)The number of users to whom this role has been assigned.
stringComment of the role.
string (date-time)Date and time when the role was created.
integer (int64)The number of roles that have been granted to this role.
integer (int64)The number of roles to which this role has been granted.
booleanSpecifies whether the role being fetched is the user's current role.
booleanSpecifies whether the role being fetched is the user's default role.
booleanSpecifies whether the role used to run the command inherits the specified role.
stringSpecifies the role that owns this role. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlike, startsWith, showLimit, fromNameList roles
endpointcreateModeCreate a role
name, endpointifExistsDelete a role
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples -List roles + + +List roles ```sql SELECT @@ -83,56 +223,48 @@ is_default, is_inherited, owner FROM snowflake.role.roles -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` -## `INSERT` example + + -Create a role + +## `INSERT` examples - + { label: 'create_role', value: 'create_role' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a role ```sql -/*+ create */ INSERT INTO snowflake.role.roles ( data__name, data__comment, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', '{{ comment }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.role.roles ( -data__name, -endpoint -) -SELECT -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: roles props: - name: endpoint @@ -140,21 +272,39 @@ SELECT description: Required parameter for the roles resource. - name: name value: string - description: Name of the role. (Required parameter for the roles resource.) + description: > + Name of the role. + - name: comment value: string - description: Comment of the role. + description: > + Comment of the role. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a role ```sql -/*+ delete */ DELETE FROM snowflake.role.roles -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/schema/schemas/index.md b/docs/snowflake-docs/providers/snowflake/schema/schemas/index.md index 6d12b8dd1..af5a4905d 100644 --- a/docs/snowflake-docs/providers/snowflake/schema/schemas/index.md +++ b/docs/snowflake-docs/providers/snowflake/schema/schemas/index.md @@ -1,4 +1,4 @@ ---- +--- title: schemas hide_title: false hide_table_of_contents: false @@ -28,65 +28,445 @@ Creates, updates, deletes, gets or lists a schemas resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Budget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects. | -| | `string` | Optional comment in which to store information related to the schema. | -| | `string` | Date and time the schema was created. | -| | `integer` | Number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema | -| | `string` | Database that the schema belongs to | -| | `string` | Specifies a default collation specification for all tables added to the schema. You an override the default at the schema and individual table levels. | -| | `string` | Date and time the schema was dropped. | -| | `boolean` | Current schema for the session. | -| | `boolean` | Default schema for a user. | -| | `string` | Schema type, permanent (default) or transient. | -| | `string` | Severity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. | -| | `boolean` | Whether this schema is a managed access schema that centralizes privilege management with the schema owner. | -| | `integer` | Maximum number of days for which Snowflake can extend the data retention period for tables in the schema to prevent streams on the tables from becoming stale. | -| | `string` | | -| | `string` | Name of the role that owns the schema. | -| | `string` | Type of role that owns the object, either `ROLE` or `DATABASE_ROLE`. | -| | `boolean` | Whether pipe execution is paused. | -| | `integer` | Number of days that historical data is retained for Time Travel. | -| | `string` | Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. | -| | `string` | Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. | -| | `integer` | Specifies the number of consecutive failed task runs after which the current task is suspended automatically. | -| | `string` | How trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`. | -| | `string` | Size of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size. | -| | `integer` | Time limit, in milliseconds, for a single run of the task before it times out. | + +The following fields are returned by `SELECT` queries: + + + + +Snowflake schema definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringDatabase that the schema belongs to
stringBudget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects.
stringOptional comment in which to store information related to the schema.
string (date-time)Date and time the schema was created.
integerNumber of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema
stringSpecifies a default collation specification for all tables added to the schema. You an override the default at the schema and individual table levels.
string (date-time)Date and time the schema was dropped.
booleanCurrent schema for the session.
booleanDefault schema for a user.
stringSchema type, permanent (default) or transient. (default: PERMANENT)
stringSeverity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`.
booleanWhether this schema is a managed access schema that centralizes privilege management with the schema owner.
integerMaximum number of days for which Snowflake can extend the data retention period for tables in the schema to prevent streams on the tables from becoming stale.
string
stringName of the role that owns the schema.
stringType of role that owns the object, either `ROLE` or `DATABASE_ROLE`.
booleanWhether pipe execution is paused.
integerNumber of days that historical data is retained for Time Travel.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
integerSpecifies the number of consecutive failed task runs after which the current task is suspended automatically.
stringHow trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`.
stringSize of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size.
integerTime limit, in milliseconds, for a single run of the task before it times out.
+
+ + +Snowflake schema definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringDatabase that the schema belongs to
stringBudget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects.
stringOptional comment in which to store information related to the schema.
string (date-time)Date and time the schema was created.
integerNumber of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema
stringSpecifies a default collation specification for all tables added to the schema. You an override the default at the schema and individual table levels.
string (date-time)Date and time the schema was dropped.
booleanCurrent schema for the session.
booleanDefault schema for a user.
stringSchema type, permanent (default) or transient. (default: PERMANENT)
stringSeverity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`.
booleanWhether this schema is a managed access schema that centralizes privilege management with the schema owner.
integerMaximum number of days for which Snowflake can extend the data retention period for tables in the schema to prevent streams on the tables from becoming stale.
string
stringName of the role that owns the schema.
stringType of role that owns the object, either `ROLE` or `DATABASE_ROLE`.
booleanWhether pipe execution is paused.
integerNumber of days that historical data is retained for Time Travel.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE.
integerSpecifies the number of consecutive failed task runs after which the current task is suspended automatically.
stringHow trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`.
stringSize of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size.
integerTime limit, in milliseconds, for a single run of the task before it times out.
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetches a schema. | -| | `SELECT` | | , , , , | Lists the accessible schemas. | -| | `INSERT` | | , | Creates a schema, with modifiers as query parameters. You must provide the full schema definition when creating a schema. | -| | `DELETE` | | , | Deletes the specified schema. If you enable the `ifExists` parameter, the operation succeeds even if the schema does not exist. Otherwise, a 404 failure is returned if the schema does not exist. if the drop is unsuccessful. | -| | `REPLACE` | | | Creates a new, or alters an existing, schema. You must provide the full schema definition even when altering an existing schema. | -| | `EXEC` | | , , | Clones an existing schema, with modifiers as query parameters. You must provide the full schema definition when cloning an existing schema. | -| | `EXEC` | | - | Undrops schema. | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Whether to include dropped schemas that have not yet been purged. Default: `false`. | `boolean` | `false` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Type of schema to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). | `string` | `` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Whether to drop the schema if foreign keys exist that reference any tables in the schema. - `true`: Return a warning about existing foreign key references and don't drop the schema. - `false`: Drop the schema and all objects in the database, including tables with primary or unique keys that are referenced by foreign keys in other tables. Default: `false`. | `boolean` | `false` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | -| | Database of the newly created schema. Defaults to the source schema's database. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, endpointlike, startsWith, showLimit, fromName, historyLists the accessible schemas.
database_name, name, endpointFetches a schema.
database_name, endpointcreateMode, kindCreates a schema, with modifiers as query parameters. You must provide the full schema definition when creating a schema.
database_name, name, endpointkindCreates a new, or alters an existing, schema. You must provide the full schema definition even when altering an existing schema.
database_name, name, endpointifExists, restrictDeletes the specified schema. If you enable the `ifExists` parameter, the operation succeeds even if the schema does not exist. Otherwise, a 404 failure is returned if the schema does not exist. if the drop is unsuccessful.
database_name, name, endpointcreateMode, kind, targetDatabaseClones an existing schema, with modifiers as query parameters. You must provide the full schema definition when cloning an existing schema.
database_name, name, endpointUndrops schema.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanWhether to include dropped schemas that have not yet been purged. Default: `false`. (default: false)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringType of schema to clone. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). (default: )
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
booleanWhether to drop the schema if foreign keys exist that reference any tables in the schema. - `true`: Return a warning about existing foreign key references and don't drop the schema. - `false`: Drop the schema and all objects in the database, including tables with primary or unique keys that are referenced by foreign keys in other tables. Default: `false`. (default: false)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
stringDatabase of the newly created schema. Defaults to the source schema's database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
## `SELECT` examples @@ -95,8 +475,8 @@ Creates, updates, deletes, gets or lists a schemas resource. values={[ { label: 'list_schemas', value: 'list_schemas' }, { label: 'fetch_schema', value: 'fetch_schema' } - ] -}> + ]} +> Lists the accessible schemas. @@ -104,11 +484,11 @@ Lists the accessible schemas. ```sql SELECT name, +database_name, budget, comment, created_on, data_retention_time_in_days, -database_name, default_ddl_collation, dropped_on, is_current, @@ -129,8 +509,13 @@ trace_level, user_task_managed_initial_warehouse_size, user_task_timeout_ms FROM snowflake.schema.schemas -WHERE database_name = '{{ database_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}' +AND history = '{{ history }}'; ``` @@ -140,11 +525,11 @@ Fetches a schema. ```sql SELECT name, +database_name, budget, comment, created_on, data_retention_time_in_days, -database_name, default_ddl_collation, dropped_on, is_current, @@ -165,29 +550,28 @@ trace_level, user_task_managed_initial_warehouse_size, user_task_timeout_ms FROM snowflake.schema.schemas -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Creates a schema, with modifiers as query parameters. You must provide the full schema definition when creating a schema. +## `INSERT` examples - + { label: 'create_schema', value: 'create_schema' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Creates a schema, with modifiers as query parameters. You must provide the full schema definition when creating a schema. ```sql -/*+ create */ INSERT INTO snowflake.schema.schemas ( data__name, data__kind, @@ -205,7 +589,9 @@ data__serverless_task_min_statement_size, data__serverless_task_max_statement_size, data__user_task_timeout_ms, database_name, -endpoint +endpoint, +createMode, +kind ) SELECT '{{ name }}', @@ -224,32 +610,16 @@ SELECT '{{ serverless_task_max_statement_size }}', {{ user_task_timeout_ms }}, '{{ database_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.schema.schemas ( -data__name, -database_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ kind }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: schemas props: - name: database_name @@ -260,126 +630,208 @@ SELECT description: Required parameter for the schemas resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the schemas resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: kind value: string - description: >- - Schema type, permanent (default) or transient. (valid values: - 'PERMANENT', 'TRANSIENT') + description: > + Schema type, permanent (default) or transient. + + valid_values: ['PERMANENT', 'TRANSIENT'] default: PERMANENT - name: comment value: string - description: Optional comment in which to store information related to the schema. + description: > + Optional comment in which to store information related to the schema. + - name: managed_access value: boolean - description: >- - Whether this schema is a managed access schema that centralizes - privilege management with the schema owner. + description: > + Whether this schema is a managed access schema that centralizes privilege management with the schema owner. + default: false - name: data_retention_time_in_days value: integer - description: >- - Number of days for which Time Travel actions (CLONE and UNDROP) can be - performed on the schema, as well as specifying the default Time Travel - retention time for all tables created in the schema + description: > + Number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema + - name: default_ddl_collation value: string - description: >- - Specifies a default collation specification for all tables added to the - schema. You an override the default at the schema and individual table - levels. + description: > + Specifies a default collation specification for all tables added to the schema. You an override the default at the schema and individual table levels. + - name: log_level value: string - description: >- - Severity level of messages that should be ingested and made available in - the active event table. Currently, Snowflake supports only `TRACE`, - `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. + description: > + Severity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` and `OFF`. + - name: pipe_execution_paused value: boolean - description: Whether pipe execution is paused. + description: > + Whether pipe execution is paused. + - name: max_data_extension_time_in_days value: integer - description: >- - Maximum number of days for which Snowflake can extend the data retention - period for tables in the schema to prevent streams on the tables from - becoming stale. + description: > + Maximum number of days for which Snowflake can extend the data retention period for tables in the schema to prevent streams on the tables from becoming stale. + - name: suspend_task_after_num_failures value: integer - description: >- - Specifies the number of consecutive failed task runs after which the - current task is suspended automatically. + description: > + Specifies the number of consecutive failed task runs after which the current task is suspended automatically. + - name: trace_level value: string - description: >- - How trace events are ingested into the event table. Currently, Snowflake - supports only `ALWAYS`, `ON_EVENT`, and `OFF`. + description: > + How trace events are ingested into the event table. Currently, Snowflake supports only `ALWAYS`, `ON_EVENT`, and `OFF`. + - name: user_task_managed_initial_warehouse_size value: string - description: >- - Size of the compute resources to provision for the first run of the - serverless task, before a task history is available for Snowflake to - determine an ideal size. + description: > + Size of the compute resources to provision for the first run of the serverless task, before a task history is available for Snowflake to determine an ideal size. + - name: serverless_task_min_statement_size value: string - description: >- - Specifies the minimum allowed warehouse size for the serverless task. - Minimum XSMALL, Maximum XXLARGE. + description: > + Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. + - name: serverless_task_max_statement_size value: string - description: >- - Specifies the maximum allowed warehouse size for the serverless task. - Minimum XSMALL, Maximum XXLARGE. + description: > + Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. + - name: user_task_timeout_ms value: integer - description: >- - Time limit, in milliseconds, for a single run of the task before it - times out. + description: > + Time limit, in milliseconds, for a single run of the task before it times out. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: kind + value: string + description: Type of schema to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). (default: ) ``` -## `REPLACE` example + +## `REPLACE` examples + + + Creates a new, or alters an existing, schema. You must provide the full schema definition even when altering an existing schema. ```sql -/*+ update */ REPLACE snowflake.schema.schemas SET -name = '{{ name }}', -kind = '{{ kind }}', -comment = '{{ comment }}', -managed_access = {{ managed_access }}, -data_retention_time_in_days = {{ data_retention_time_in_days }}, -default_ddl_collation = '{{ default_ddl_collation }}', -log_level = '{{ log_level }}', -pipe_execution_paused = {{ pipe_execution_paused }}, -max_data_extension_time_in_days = {{ max_data_extension_time_in_days }}, -suspend_task_after_num_failures = {{ suspend_task_after_num_failures }}, -trace_level = '{{ trace_level }}', -user_task_managed_initial_warehouse_size = '{{ user_task_managed_initial_warehouse_size }}', -serverless_task_min_statement_size = '{{ serverless_task_min_statement_size }}', -serverless_task_max_statement_size = '{{ serverless_task_max_statement_size }}', -user_task_timeout_ms = {{ user_task_timeout_ms }} +data__name = '{{ name }}', +data__kind = '{{ kind }}', +data__comment = '{{ comment }}', +data__managed_access = {{ managed_access }}, +data__data_retention_time_in_days = {{ data_retention_time_in_days }}, +data__default_ddl_collation = '{{ default_ddl_collation }}', +data__log_level = '{{ log_level }}', +data__pipe_execution_paused = {{ pipe_execution_paused }}, +data__max_data_extension_time_in_days = {{ max_data_extension_time_in_days }}, +data__suspend_task_after_num_failures = {{ suspend_task_after_num_failures }}, +data__trace_level = '{{ trace_level }}', +data__user_task_managed_initial_warehouse_size = '{{ user_task_managed_initial_warehouse_size }}', +data__serverless_task_min_statement_size = '{{ serverless_task_min_statement_size }}', +data__serverless_task_max_statement_size = '{{ serverless_task_max_statement_size }}', +data__user_task_timeout_ms = {{ user_task_timeout_ms }} WHERE -database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +database_name = '{{ database_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required +AND kind = '{{ kind}}'; ``` + + -## `DELETE` example + +## `DELETE` examples + + + Deletes the specified schema. If you enable the `ifExists` parameter, the operation succeeds even if the schema does not exist. Otherwise, a 404 failure is returned if the schema does not exist. if the drop is unsuccessful. ```sql -/*+ delete */ DELETE FROM snowflake.schema.schemas -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}' +AND restrict = '{{ restrict }}'; ``` + + + + +## Lifecycle Methods + + + + +Clones an existing schema, with modifiers as query parameters. You must provide the full schema definition when cloning an existing schema. + +```sql +EXEC snowflake.schema.schemas.clone_schema +@database_name='{{ database_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@kind='{{ kind }}', +@targetDatabase='{{ targetDatabase }}' +@@json= +'{ +"name": "{{ name }}", +"kind": "{{ kind }}", +"comment": "{{ comment }}", +"managed_access": {{ managed_access }}, +"data_retention_time_in_days": {{ data_retention_time_in_days }}, +"default_ddl_collation": "{{ default_ddl_collation }}", +"log_level": "{{ log_level }}", +"pipe_execution_paused": {{ pipe_execution_paused }}, +"max_data_extension_time_in_days": {{ max_data_extension_time_in_days }}, +"suspend_task_after_num_failures": {{ suspend_task_after_num_failures }}, +"trace_level": "{{ trace_level }}", +"user_task_managed_initial_warehouse_size": "{{ user_task_managed_initial_warehouse_size }}", +"serverless_task_min_statement_size": "{{ serverless_task_min_statement_size }}", +"serverless_task_max_statement_size": "{{ serverless_task_max_statement_size }}", +"user_task_timeout_ms": {{ user_task_timeout_ms }} +}'; +``` + + + +Undrops schema. + +```sql +EXEC snowflake.schema.schemas.undrop_schema +@database_name='{{ database_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/sqlapi/statements/index.md b/docs/snowflake-docs/providers/snowflake/sqlapi/statements/index.md index 83edebb10..19efe0ff6 100644 --- a/docs/snowflake-docs/providers/snowflake/sqlapi/statements/index.md +++ b/docs/snowflake-docs/providers/snowflake/sqlapi/statements/index.md @@ -1,4 +1,4 @@ ---- +--- title: statements hide_title: false hide_table_of_contents: false @@ -28,31 +28,147 @@ Creates, updates, deletes, gets or lists a statements resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | | -| | `integer` | Timestamp that specifies when the statement execution started.‌ The timestamp is expressed in milliseconds since the epoch.‌ | -| | `array` | Result set data. | -| | `string` | | -| | `object` | | -| | `string` | | -| | `string` | | -| | `string` | | -| | `object` | these stats might not be available for each request. | + +The following fields are returned by `SELECT` queries: + + + + +The statement was executed successfully, and the response includes any data requested. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
string (example: 000123)
integer (int64)Timestamp that specifies when the statement execution started.‌ The timestamp is expressed in milliseconds since the epoch.‌
arrayResult set data.
string (example: successfully executed)
object
string (example: 42601)
string (uuid) (example: 536fad38-b564-4dc5-9892-a4543504df6c)
string (uri)
objectthese stats might not be available for each request.
+
+
## Methods -| Name | Accessible by | Required Params | Description | -|:-----|:--------------|:----------------|:------------| -| | `SELECT` | | Checks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set. | -| | `INSERT` | | Submits one or more statements for execution. You can specify that the statement should be executed asynchronously. | -| | `DELETE` | | Cancels the execution of the statement with the specified statement handle. | -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointChecks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set.
endpointSubmits one or more statements for execution. You can specify that the statement should be executed asynchronously.
endpointCancels the execution of the statement with the specified statement handle.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
## `SELECT` examples -Checks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set. + + +Checks the status of the execution of the statement with the specified statement handle. If the statement was executed successfully, the operation returns the requested partition of the result set. ```sql SELECT @@ -66,26 +182,26 @@ statementHandle, statementStatusUrl, stats FROM snowflake.sqlapi.statements -WHERE User-Agent = '{{ User-Agent }}' -AND statementHandle = '{{ statementHandle }}' -AND endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example + + -Submits one or more statements for execution. You can specify that the statement should be executed asynchronously. + +## `INSERT` examples - + { label: 'submit_statement', value: 'submit_statement' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Submits one or more statements for execution. You can specify that the statement should be executed asynchronously. ```sql -/*+ create */ INSERT INTO snowflake.sqlapi.statements ( data__statement, data__timeout, @@ -95,7 +211,6 @@ data__warehouse, data__role, data__bindings, data__parameters, -User-Agent, endpoint ) SELECT @@ -107,105 +222,79 @@ SELECT '{{ role }}', '{{ bindings }}', '{{ parameters }}', -'{{ User-Agent }}', '{{ endpoint }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.sqlapi.statements ( -User-Agent, -endpoint -) -SELECT -'{{ User-Agent }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: statements props: - - name: User-Agent - value: string - description: Required parameter for the statements resource. - name: endpoint value: string description: Required parameter for the statements resource. - name: statement value: string - description: >- - SQL statement or batch of SQL statements to execute. You can specify - query, DML and DDL statements. The following statements are not - supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, ROLLBACK, - statements that set session variables, and statements that create - temporary tables and stages. + description: > + SQL statement or batch of SQL statements to execute. You can specify query, DML and DDL statements. The following statements are not supported: PUT, GET, USE, ALTER SESSION, BEGIN, COMMIT, ROLLBACK, statements that set session variables, and statements that create temporary tables and stages. + - name: timeout value: integer - description: >- - Timeout in seconds for statement execution. If the execution of a - statement takes longer than the specified timeout, the execution is - automatically canceled. To set the timeout to the maximum value (604800 - seconds), set timeout to 0. + description: > + Timeout in seconds for statement execution. If the execution of a statement takes longer than the specified timeout, the execution is automatically canceled. To set the timeout to the maximum value (604800 seconds), set timeout to 0. + - name: database value: string - description: >- - Database in which the statement should be executed. The value in this - field is case-sensitive. + description: > + Database in which the statement should be executed. The value in this field is case-sensitive. + - name: schema value: string - description: >- - Schema in which the statement should be executed. The value in this - field is case-sensitive. + description: > + Schema in which the statement should be executed. The value in this field is case-sensitive. + - name: warehouse value: string - description: >- - Warehouse to use when executing the statement. The value in this field - is case-sensitive. + description: > + Warehouse to use when executing the statement. The value in this field is case-sensitive. + - name: role value: string - description: >- - Role to use when executing the statement. The value in this field is - case-sensitive. + description: > + Role to use when executing the statement. The value in this field is case-sensitive. + - name: bindings - value: {} - description: >- - Values of bind variables in the SQL statement. When executing the - statement, Snowflake replaces placeholders ('?' and ':name') in the - statement with these specified values. + value: object + description: > + Values of bind variables in the SQL statement. When executing the statement, Snowflake replaces placeholders ('?' and ':name') in the statement with these specified values. + - name: parameters - value: - timezone: string - query_tag: string - binary_output_format: string - date_output_format: string - time_output_format: string - timestamp_output_format: string - timestamp_ltz_output_format: string - timestamp_ntz_output_format: string - timestamp_tz_output_format: string - multi_statement_count: integer - description: Session parameters that should be set before executing the statement. + value: object + description: > + Session parameters that should be set before executing the statement. + ``` -## `DELETE` example + +## `DELETE` examples + + + Cancels the execution of the statement with the specified statement handle. ```sql -/*+ delete */ DELETE FROM snowflake.sqlapi.statements -WHERE User-Agent = '{{ User-Agent }}' -AND statementHandle = '{{ statementHandle }}' -AND endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' --required; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/stage/files/index.md b/docs/snowflake-docs/providers/snowflake/stage/files/index.md index 4c0a1410c..c0bad49f3 100644 --- a/docs/snowflake-docs/providers/snowflake/stage/files/index.md +++ b/docs/snowflake-docs/providers/snowflake/stage/files/index.md @@ -1,4 +1,4 @@ ---- +--- title: files hide_title: false hide_table_of_contents: false @@ -28,34 +28,128 @@ Creates, updates, deletes, gets or lists a files resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the file. | -| | `string` | Date and time when the file was last modified. | -| | `string` | md5 hash of the file. | -| | `string` | Size of the file. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List files in the stage -- this is equivalent to LIST @stage. | +The following fields are returned by `SELECT` queries: + + + + +A file on a snowflake stage. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the file.
stringDate and time when the file was last modified.
stringmd5 hash of the file.
stringSize of the file.
+
+
+## Methods + +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, name, endpointpatternList files in the stage -- this is equivalent to LIST @stage.
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | A query parameter that filters the command output by a regular expression pattern. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringA query parameter that filters the command output by a regular expression pattern. (example: .*data_0.*)
## `SELECT` examples -List files in the stage -- this is equivalent to LIST @stage. + + +List files in the stage -- this is equivalent to LIST @stage. ```sql SELECT @@ -64,8 +158,11 @@ last_modified, md5, size FROM snowflake.stage.files -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND pattern = '{{ pattern }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/stage/presigned_url/index.md b/docs/snowflake-docs/providers/snowflake/stage/presigned_url/index.md index 757a6689f..3fd965abb 100644 --- a/docs/snowflake-docs/providers/snowflake/stage/presigned_url/index.md +++ b/docs/snowflake-docs/providers/snowflake/stage/presigned_url/index.md @@ -1,4 +1,4 @@ ---- +--- title: presigned_url hide_title: false hide_table_of_contents: false @@ -28,29 +28,123 @@ Creates, updates, deletes, gets or lists a presigned_url resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Presigned url for file transfer, only works for Server Side Encrypted Stages. | + +The following fields are returned by `SELECT` queries: + + + + +Materials for uploading and downloading stage files + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringPresigned url for file transfer, only works for Server Side Encrypted Stages.
+
+
## Methods -| Name | Accessible by | Required Params | Description | -|:-----|:--------------|:----------------|:------------| -| | `SELECT` | | Generate a presigned url and optionally encryption materials for uploading and downloading files. | -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, name, filePath, endpointGenerate a presigned url and optionally encryption materials for uploading and downloading files.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringThe full stage path of the file.
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
## `SELECT` examples -Generate a presigned url and optionally encryption materials for uploading and downloading files. + + +Generate a presigned url and optionally encryption materials for uploading and downloading files. ```sql SELECT presigned_url FROM snowflake.stage.presigned_url -WHERE database_name = '{{ database_name }}' -AND filePath = '{{ filePath }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND filePath = '{{ filePath }}' -- required +AND endpoint = '{{ endpoint }}' -- required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/stage/stages/index.md b/docs/snowflake-docs/providers/snowflake/stage/stages/index.md index 35d532f46..470905511 100644 --- a/docs/snowflake-docs/providers/snowflake/stage/stages/index.md +++ b/docs/snowflake-docs/providers/snowflake/stage/stages/index.md @@ -1,4 +1,4 @@ ---- +--- title: stages hide_title: false hide_table_of_contents: false @@ -28,46 +28,304 @@ Creates, updates, deletes, gets or lists a stages resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Cloud provider; always NULL for an internal stage. | -| | `string` | Specifies a comment for the stage. | -| | `string` | Date and time when the stage was created. | -| | `object` | Specifies the credentials of the stage. | -| | `object` | Directory table parameters of the stage. | -| | `object` | Encryption parameters of the stage. | -| | `string` | The S3-compatible API endpoint associated with the stage; always NULL for stages that are not S3-compatible. | -| | `boolean` | Indicates that the external stage has access credentials; always false for an internal stage. | -| | `boolean` | Indicates that the external stage contains encrypted files; always false for an internal stage. | -| | `string` | Specifies whether the stage is permanent or temporary. | -| | `string` | Role that owns the stage. | -| | `string` | The type of role that owns the object, either ROLE or DATABASE_ROLE. If a Snowflake Native App owns the object, the value is APPLICATION. Snowflake returns NULL if you delete the object because a deleted object does not have an owner role. | -| | `string` | Region where the stage is located. | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | URL for the external stage; blank for an internal stage. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a stage using the describe command output. | -| | `SELECT` | | | Lists stages under the database and schema, with show options as query parameters. | -| | `INSERT` | | | Create a stage, with standard create modifiers as query parameters. See the Stage component definition for what is required to be provided in the request body. | -| | `DELETE` | | | Delete a stage with the stage name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful. | +The following fields are returned by `SELECT` queries: + + + + +A Snowflake stage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringCloud provider; always NULL for an internal stage.
stringSpecifies a comment for the stage.
string (date-time)Date and time when the stage was created.
objectSpecifies the credentials of the stage.
objectDirectory table parameters of the stage.
objectEncryption parameters of the stage.
stringThe S3-compatible API endpoint associated with the stage; always NULL for stages that are not S3-compatible.
booleanIndicates that the external stage has access credentials; always false for an internal stage.
booleanIndicates that the external stage contains encrypted files; always false for an internal stage.
stringSpecifies whether the stage is permanent or temporary. (default: PERMANENT)
stringRole that owns the stage.
stringThe type of role that owns the object, either ROLE or DATABASE_ROLE. If a Snowflake Native App owns the object, the value is APPLICATION. Snowflake returns NULL if you delete the object because a deleted object does not have an owner role.
stringRegion where the stage is located.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringURL for the external stage; blank for an internal stage.
+
+ + +A Snowflake stage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringCloud provider; always NULL for an internal stage.
stringSpecifies a comment for the stage.
string (date-time)Date and time when the stage was created.
objectSpecifies the credentials of the stage.
objectDirectory table parameters of the stage.
objectEncryption parameters of the stage.
stringThe S3-compatible API endpoint associated with the stage; always NULL for stages that are not S3-compatible.
booleanIndicates that the external stage has access credentials; always false for an internal stage.
booleanIndicates that the external stage contains encrypted files; always false for an internal stage.
stringSpecifies whether the stage is permanent or temporary. (default: PERMANENT)
stringRole that owns the stage.
stringThe type of role that owns the object, either ROLE or DATABASE_ROLE. If a Snowflake Native App owns the object, the value is APPLICATION. Snowflake returns NULL if you delete the object because a deleted object does not have an owner role.
stringRegion where the stage is located.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringURL for the external stage; blank for an internal stage.
+
+
-
+## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlikeLists stages under the database and schema, with show options as query parameters.
database_name, schema_name, name, endpointFetch a stage using the describe command output.
database_name, schema_name, endpointcreateModeCreate a stage, with standard create modifiers as query parameters. See the Stage component definition for what is required to be provided in the request body.
database_name, schema_name, name, endpointifExistsDelete a stage with the stage name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful.
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -76,8 +334,8 @@ Creates, updates, deletes, gets or lists a stages resource. values={[ { label: 'list_stages', value: 'list_stages' }, { label: 'fetch_stage', value: 'fetch_stage' } - ] -}> + ]} +> Lists stages under the database and schema, with show options as query parameters. @@ -101,9 +359,10 @@ region, storage_integration, url FROM snowflake.stage.stages -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -129,30 +388,29 @@ region, storage_integration, url FROM snowflake.stage.stages -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a stage, with standard create modifiers as query parameters. See the Stage component definition for what is required to be provided in the request body. +## `INSERT` examples - + { label: 'create_stage', value: 'create_stage' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a stage, with standard create modifiers as query parameters. See the Stage component definition for what is required to be provided in the request body. ```sql -/*+ create */ INSERT INTO snowflake.stage.stages ( data__name, data__kind, @@ -165,7 +423,8 @@ data__encryption, data__directory_table, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -178,34 +437,16 @@ SELECT '{{ encryption }}', '{{ directory_table }}', '{{ database_name }}', -'{{ schema_name }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.stage.stages ( -data__name, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: stages props: - name: database_name @@ -219,64 +460,78 @@ SELECT description: Required parameter for the stages resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the stages resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: kind value: string - description: >- - Specifies whether the stage is permanent or temporary. (valid values: - 'PERMANENT', 'TEMPORARY') + description: > + Specifies whether the stage is permanent or temporary. + + valid_values: ['PERMANENT', 'TEMPORARY'] default: PERMANENT - name: url value: string - description: URL for the external stage; blank for an internal stage. + description: > + URL for the external stage; blank for an internal stage. + - name: endpoint value: string - description: >- - The S3-compatible API endpoint associated with the stage; always NULL - for stages that are not S3-compatible. + description: > + The S3-compatible API endpoint associated with the stage; always NULL for stages that are not S3-compatible. + - name: storage_integration value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: comment value: string - description: Specifies a comment for the stage. + description: > + Specifies a comment for the stage. + - name: credentials - value: - credential_type: string - description: Specifies the credentials of the stage. + value: object + description: > + Specifies the credentials of the stage. + - name: encryption - value: - type: string - master_key: string - kms_key_id: string - description: Encryption parameters of the stage. + value: object + description: > + Encryption parameters of the stage. + - name: directory_table - value: - enable: boolean - refresh_on_create: boolean - auto_refresh: boolean - notification_integration: string - description: Directory table parameters of the stage. + value: object + description: > + Directory table parameters of the stage. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a stage with the stage name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful. ```sql -/*+ delete */ DELETE FROM snowflake.stage.stages -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/streams/streams/index.md b/docs/snowflake-docs/providers/snowflake/streams/streams/index.md index 7fabff38b..1c5e3374f 100644 --- a/docs/snowflake-docs/providers/snowflake/streams/streams/index.md +++ b/docs/snowflake-docs/providers/snowflake/streams/streams/index.md @@ -1,4 +1,4 @@ ---- +--- title: streams hide_title: false hide_table_of_contents: false @@ -28,49 +28,321 @@ Creates, updates, deletes, gets or lists a streams resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the stream | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | Date and time when the stream was created. | -| | `string` | Database in which the stream is stored | -| | `string` | Reason why the stream cannot be queried successfully. This column supports future functionality. Currently, the only value returned is N/A. | -| | `string` | Mode of the stream. Possible values include: APPEND_ONLY, INSERT_ONLY. For streams on tables, the column displays DEFAULT. | -| | `string` | Role that owns the stream | -| | `string` | The type of role that owns the stream | -| | `string` | Schema in which the stream is stored | -| | `boolean` | Specifies whether the stream is stale or not | -| | `string` | Timestamp when the stream became stale or may become stale if not consumed. | -| | `object` | | -| | `string` | Table name whose changes are tracked by the stream | -| | `string` | Type of the stream; currently DELTA only. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a stream | -| | `SELECT` | | , , , | List streams | -| | `INSERT` | | , | Create a stream | -| | `DELETE` | | | Delete a stream | -| | `EXEC` | | , | Clone a stream | +The following fields are returned by `SELECT` queries: + + + -
+A Snowflake stream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringDatabase in which the stream is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema in which the stream is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringTable name whose changes are tracked by the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the stream was created.
stringReason why the stream cannot be queried successfully. This column supports future functionality. Currently, the only value returned is N/A.
stringMode of the stream. Possible values include: APPEND_ONLY, INSERT_ONLY. For streams on tables, the column displays DEFAULT.
stringRole that owns the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether the stream is stale or not
string (date-time)Timestamp when the stream became stale or may become stale if not consumed.
object
stringType of the stream; currently DELTA only.
+
+ + +A Snowflake stream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringDatabase in which the stream is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema in which the stream is stored (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringTable name whose changes are tracked by the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the stream was created.
stringReason why the stream cannot be queried successfully. This column supports future functionality. Currently, the only value returned is N/A.
stringMode of the stream. Possible values include: APPEND_ONLY, INSERT_ONLY. For streams on tables, the column displays DEFAULT.
stringRole that owns the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the stream (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanSpecifies whether the stream is stale or not
string (date-time)Timestamp when the stream became stale or may become stale if not consumed.
object
stringType of the stream; currently DELTA only.
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromNameList streams
database_name, schema_name, name, endpointFetch a stream
database_name, schema_name, endpointcreateMode, copyGrantsCreate a stream
database_name, schema_name, name, endpointifExistsDelete a stream
database_name, schema_name, name, targetDatabase, targetSchema, endpointcreateMode, copyGrantsClone a stream
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringDatabase of the target resource. Defaults to the source's database (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema of the target resource. Defaults to the source's schema (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -79,8 +351,8 @@ Creates, updates, deletes, gets or lists a streams resource. values={[ { label: 'list_streams', value: 'list_streams' }, { label: 'fetch_stream', value: 'fetch_stream' } - ] -}> + ]} +> List streams @@ -88,23 +360,27 @@ List streams ```sql SELECT name, +database_name, +schema_name, +table_name, comment, created_on, -database_name, invalid_reason, mode, owner, owner_role_type, -schema_name, stale, stale_after, stream_source, -table_name, type FROM snowflake.streams.streams -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` @@ -114,51 +390,52 @@ Fetch a stream ```sql SELECT name, +database_name, +schema_name, +table_name, comment, created_on, -database_name, invalid_reason, mode, owner, owner_role_type, -schema_name, stale, stale_after, stream_source, -table_name, type FROM snowflake.streams.streams -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a stream +## `INSERT` examples - + { label: 'create_stream', value: 'create_stream' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a stream ```sql -/*+ create */ INSERT INTO snowflake.streams.streams ( data__name, data__stream_source, data__comment, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -166,36 +443,16 @@ SELECT '{{ comment }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.streams.streams ( -data__name, -data__stream_source, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ stream_source }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: streams props: - name: database_name @@ -209,30 +466,78 @@ SELECT description: Required parameter for the streams resource. - name: name value: string - description: Name of the stream (Required parameter for the streams resource.) + description: > + Name of the stream + - name: stream_source - value: - src_type: string - name: string - database_name: string - schema_name: string - description: Required parameter for the streams resource. + value: object - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a stream ```sql -/*+ delete */ DELETE FROM snowflake.streams.streams -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + + + +## Lifecycle Methods + + + + +Clone a stream + +```sql +EXEC snowflake.streams.streams.clone_stream +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetDatabase='{{ targetDatabase }}' --required, +@targetSchema='{{ targetSchema }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }} +@@json= +'{ +"name": "{{ name }}", +"comment": "{{ comment }}" +}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/table/tables/index.md b/docs/snowflake-docs/providers/snowflake/table/tables/index.md index d86dd7c72..a41667504 100644 --- a/docs/snowflake-docs/providers/snowflake/table/tables/index.md +++ b/docs/snowflake-docs/providers/snowflake/table/tables/index.md @@ -1,4 +1,4 @@ ---- +--- title: tables hide_title: false hide_table_of_contents: false @@ -28,78 +28,559 @@ Creates, updates, deletes, gets or lists a tables resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Specifies the name for the table, must be unique for the schema in which the table is created | -| | `boolean` | If Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table. | -| | `string` | Name of the budget if the object is monitored by a budget | -| | `integer` | Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table | -| | `boolean` | Change tracking is enabled or disabled | -| | `array` | Specifies one or more columns or column expressions in the table as the clustering key | -| | `array` | | -| | `string` | Comment for the table | -| | `array` | | -| | `string` | Date and time when the table was created. | -| | `integer` | Specifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table | -| | `string` | Database in which the table is stored | -| | `string` | Specifies a default collation specification for the columns in the table, including columns added to the table in the future | -| | `string` | Date and time when the table was dropped | -| | `boolean` | Table has schema evolution enabled or disabled | -| | `string` | Table type - permanent, transient, or temporary | -| | `integer` | Specifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table | -| | `string` | Role that owns the table | -| | `string` | The type of role that owns the object. | -| | `integer` | Number of rows in the table. Returns NULL for external tables. | -| | `string` | Schema in which the table is stored | -| | `boolean` | If ON, the table has the search optimization service enabled | -| | `integer` | Number of additional bytes of storage that the search optimization service consumes for this table | -| | `integer` | Percentage of the table that has been optimized for search. | -| | `string` | Type of the table | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringSpecifies the name for the table, must be unique for the schema in which the table is created
stringDatabase in which the table is stored
stringSchema in which the table is stored
booleanIf Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table.
stringName of the budget if the object is monitored by a budget
integer (int64)Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table
booleanChange tracking is enabled or disabled
arraySpecifies one or more columns or column expressions in the table as the clustering key
array
stringComment for the table
array
string (date-time)Date and time when the table was created.
integerSpecifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table
stringSpecifies a default collation specification for the columns in the table, including columns added to the table in the future
string (date-time)Date and time when the table was dropped
booleanTable has schema evolution enabled or disabled
stringTable type - permanent, transient, or temporary (default: PERMANENT)
integerSpecifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table
stringRole that owns the table
stringThe type of role that owns the object.
integer (int64)Number of rows in the table. Returns NULL for external tables.
booleanIf ON, the table has the search optimization service enabled
integer (int64)Number of additional bytes of storage that the search optimization service consumes for this table
integer (int64)Percentage of the table that has been optimized for search.
stringType of the table
+
+ + +A Snowflake table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringSpecifies the name for the table, must be unique for the schema in which the table is created
stringDatabase in which the table is stored
stringSchema in which the table is stored
booleanIf Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table.
stringName of the budget if the object is monitored by a budget
integer (int64)Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table
booleanChange tracking is enabled or disabled
arraySpecifies one or more columns or column expressions in the table as the clustering key
array
stringComment for the table
array
string (date-time)Date and time when the table was created.
integerSpecifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table
stringSpecifies a default collation specification for the columns in the table, including columns added to the table in the future
string (date-time)Date and time when the table was dropped
booleanTable has schema evolution enabled or disabled
stringTable type - permanent, transient, or temporary (default: PERMANENT)
integerSpecifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table
stringRole that owns the table
stringThe type of role that owns the object.
integer (int64)Number of rows in the table. Returns NULL for external tables.
booleanIf ON, the table has the search optimization service enabled
integer (int64)Number of additional bytes of storage that the search optimization service consumes for this table
integer (int64)Percentage of the table that has been optimized for search.
stringType of the table
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a Table using the describe command output. | -| | `SELECT` | | , , , , , | Lists the tables under the database and schema. | -| | `INSERT` | | , | Create a table. | -| | `DELETE` | | | Delete a table with the given name. | -| | `REPLACE` | | - | Create a (or alter an existing) table. Even if the operation is just an alter, the full property set must be provided. | -| | `EXEC` | | , , , | Create a new table by cloning from the specified resource | -| | `EXEC` | | , | Create a table as select. | -| | `EXEC` | | , | Create a table as select. | -| | `EXEC` | | , | Create a new table like the specified resource, but empty | -| | `EXEC` | | , | Create a new table like the specified resource, but empty | -| | `EXEC` | | , | Create a table using template. | -| | `EXEC` | | , | Create a table using template. | -| | `EXEC` | | | Resume recluster of a table | -| | `EXEC` | | | Resume recluster of a table | -| | `EXEC` | | | Suspend recluster of a table | -| | `EXEC` | | | Suspend recluster of a table | -| | `EXEC` | | , , | Swap with another table | -| | `EXEC` | | | Swap with another table | -| | `EXEC` | | - | Undrop specified table | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Optionally includes dependency information of the table. | `boolean` | `-` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Optionally includes dropped tables that have not yet been purged. | `boolean` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | -| | Database of the newly created table. Defaults to the source table's database. | `string` | `-` | -| | Schema of the newly created table. Defaults to the source table's schema. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromName, history, deepLists the tables under the database and schema.
database_name, schema_name, name, endpointFetch a Table using the describe command output.
database_name, schema_name, endpointcreateMode, copyGrantsCreate a table.
database_name, schema_name, name, endpointCreate a (or alter an existing) table. Even if the operation is just an alter, the full property set must be provided.
database_name, schema_name, name, endpointifExistsDelete a table with the given name.
database_name, schema_name, name, query, endpointcreateMode, copyGrantsCreate a table as select.
database_name, schema_name, query, endpointcreateMode, copyGrantsCreate a table as select.
database_name, schema_name, name, query, endpointcreateMode, copyGrantsCreate a table using template.
database_name, schema_name, query, endpointcreateMode, copyGrantsCreate a table using template.
database_name, schema_name, name, endpointcreateMode, copyGrants, targetDatabase, targetSchemaCreate a new table by cloning from the specified resource
database_name, schema_name, name, newTableName, endpointcreateMode, copyGrantsCreate a new table like the specified resource, but empty
database_name, schema_name, name, endpointcreateMode, copyGrantsCreate a new table like the specified resource, but empty
database_name, schema_name, name, endpointUndrop specified table
database_name, schema_name, name, endpointifExistsSuspend recluster of a table
database_name, schema_name, name, endpointifExistsSuspend recluster of a table
database_name, schema_name, name, endpointifExistsResume recluster of a table
database_name, schema_name, name, endpointifExistsResume recluster of a table
database_name, schema_name, name, targetTableName, endpointifExistsSwap with another table
database_name, schema_name, name, targetName, endpointifExists, targetDatabase, targetSchemaSwap with another table
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe name of the table to be created.
stringThe SQL query that uses INFER_SCHEMA on staged files to set the column definitions for the new table.
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe name of the target table to be swapped with. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe fully-specified name of the target table to be swapped with.
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanOptionally includes dependency information of the table.
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanOptionally includes dropped tables that have not yet been purged.
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
stringDatabase of the target table. Defaults to the source table's database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSchema of the target table. Defaults to the source table's schema. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
## `SELECT` examples @@ -108,8 +589,8 @@ Creates, updates, deletes, gets or lists a tables resource. values={[ { label: 'list_tables', value: 'list_tables' }, { label: 'fetch_table', value: 'fetch_table' } - ] -}> + ]} +> Lists the tables under the database and schema. @@ -117,6 +598,8 @@ Lists the tables under the database and schema. ```sql SELECT name, +database_name, +schema_name, automatic_clustering, budget, bytes, @@ -127,7 +610,6 @@ comment, constraints, created_on, data_retention_time_in_days, -database_name, default_ddl_collation, dropped_on, enable_schema_evolution, @@ -136,15 +618,20 @@ max_data_extension_time_in_days, owner, owner_role_type, rows, -schema_name, search_optimization, search_optimization_bytes, search_optimization_progress, table_type FROM snowflake.table.tables -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}' +AND history = '{{ history }}' +AND deep = '{{ deep }}'; ``` @@ -154,6 +641,8 @@ Fetch a Table using the describe command output. ```sql SELECT name, +database_name, +schema_name, automatic_clustering, budget, bytes, @@ -164,7 +653,6 @@ comment, constraints, created_on, data_retention_time_in_days, -database_name, default_ddl_collation, dropped_on, enable_schema_evolution, @@ -173,36 +661,34 @@ max_data_extension_time_in_days, owner, owner_role_type, rows, -schema_name, search_optimization, search_optimization_bytes, search_optimization_progress, table_type FROM snowflake.table.tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a table. +## `INSERT` examples - + { label: 'create_table', value: 'create_table' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a table. ```sql -/*+ create */ INSERT INTO snowflake.table.tables ( data__name, data__kind, @@ -217,7 +703,9 @@ data__constraints, data__comment, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -233,34 +721,16 @@ SELECT '{{ comment }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.table.tables ( -data__name, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: tables props: - name: database_name @@ -274,140 +744,385 @@ SELECT description: Required parameter for the tables resource. - name: name value: string - description: >- - Specifies the name for the table, must be unique for the schema in which - the table is created (Required parameter for the tables resource.) + description: > + Specifies the name for the table, must be unique for the schema in which the table is created + - name: kind value: string - description: >- - Table type - permanent, transient, or temporary (valid values: - 'PERMANENT', 'TRANSIENT', 'TEMPORARY', '', 'transient', 'temporary') + description: > + Table type - permanent, transient, or temporary + + valid_values: ['PERMANENT', 'TRANSIENT', 'TEMPORARY', '', 'transient', 'temporary'] default: PERMANENT - name: cluster_by value: array - description: >- - Specifies one or more columns or column expressions in the table as the - clustering key + description: > + Specifies one or more columns or column expressions in the table as the clustering key + - name: enable_schema_evolution value: boolean - description: Table has schema evolution enabled or disabled + description: > + Table has schema evolution enabled or disabled + - name: change_tracking value: boolean - description: Change tracking is enabled or disabled + description: > + Change tracking is enabled or disabled + - name: data_retention_time_in_days value: integer - description: >- - Specifies the retention period for the table so that Time Travel actions - SELECT, CLONE, UNDROP can be performed on historical data in the table + description: > + Specifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table + - name: max_data_extension_time_in_days value: integer - description: >- - Specifies the retention period for the table so that Time Travel actions - SELECT, CLONE, UNDROP can be performed on historical data in the table + description: > + Specifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table + - name: default_ddl_collation value: string - description: >- - Specifies a default collation specification for the columns in the - table, including columns added to the table in the future + description: > + Specifies a default collation specification for the columns in the table, including columns added to the table in the future + - name: columns - value: - - name: name - value: string - description: Column name - - name: datatype - value: string - description: The data type for the column - - name: nullable - value: boolean - description: Specifies that the column does allow NULL values or not. - default: true - - name: collate - value: string - description: >- - Specifies the collation to use for column operations such as string - comparison - - name: default - value: string - description: >- - Specifies whether a default value is automatically inserted in the - column if a value is not explicitly specified via an INSERT or - CREATE TABLE AS SELECT statement - - name: autoincrement - value: boolean - - name: autoincrement_start - value: integer - description: The default value for the column starts with the specified number - - name: autoincrement_increment - value: integer - description: >- - Each successive value for the column automatically increments by the - specified amount - - name: constraints - value: - - name: name - value: string - description: Name of the Constraint - - name: column_names - value: array - - name: constraint_type - value: string - description: Type of the constraint - - name: comment - value: string - description: Specifies a comment for the column + value: array - name: constraints - value: - - name: name - value: string - description: Name of the Constraint - - name: column_names - value: array - - name: constraint_type - value: string - description: Type of the constraint + value: array - name: comment value: string - description: Comment for the table + description: > + Comment for the table + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `REPLACE` example + +## `REPLACE` examples + + + Create a (or alter an existing) table. Even if the operation is just an alter, the full property set must be provided. ```sql -/*+ update */ REPLACE snowflake.table.tables SET -name = '{{ name }}', -kind = '{{ kind }}', -cluster_by = '{{ cluster_by }}', -enable_schema_evolution = {{ enable_schema_evolution }}, -change_tracking = {{ change_tracking }}, -data_retention_time_in_days = {{ data_retention_time_in_days }}, -max_data_extension_time_in_days = {{ max_data_extension_time_in_days }}, -default_ddl_collation = '{{ default_ddl_collation }}', -columns = '{{ columns }}', -constraints = '{{ constraints }}', -comment = '{{ comment }}' +data__name = '{{ name }}', +data__kind = '{{ kind }}', +data__cluster_by = '{{ cluster_by }}', +data__enable_schema_evolution = {{ enable_schema_evolution }}, +data__change_tracking = {{ change_tracking }}, +data__data_retention_time_in_days = {{ data_retention_time_in_days }}, +data__max_data_extension_time_in_days = {{ max_data_extension_time_in_days }}, +data__default_ddl_collation = '{{ default_ddl_collation }}', +data__columns = '{{ columns }}', +data__constraints = '{{ constraints }}', +data__comment = '{{ comment }}' WHERE -database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required; ``` + + -## `DELETE` example + +## `DELETE` examples + + + Delete a table with the given name. ```sql -/*+ delete */ DELETE FROM snowflake.table.tables -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Create a table as select. + +```sql +EXEC snowflake.table.tables.create_table_as_select_deprecated +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@query='{{ query }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }} +@@json= +'{ +"name": "{{ name }}", +"kind": "{{ kind }}", +"cluster_by": "{{ cluster_by }}", +"enable_schema_evolution": {{ enable_schema_evolution }}, +"change_tracking": {{ change_tracking }}, +"data_retention_time_in_days": {{ data_retention_time_in_days }}, +"max_data_extension_time_in_days": {{ max_data_extension_time_in_days }}, +"default_ddl_collation": "{{ default_ddl_collation }}", +"columns": "{{ columns }}", +"constraints": "{{ constraints }}", +"comment": "{{ comment }}" +}'; +``` + + + +Create a table as select. + +```sql +EXEC snowflake.table.tables.create_table_as_select +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@query='{{ query }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }} +@@json= +'{ +"name": "{{ name }}", +"columns": "{{ columns }}", +"cluster_by": "{{ cluster_by }}" +}'; +``` + + + +Create a table using template. + +```sql +EXEC snowflake.table.tables.create_table_using_template_deprecated +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@query='{{ query }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }}; +``` + + + +Create a table using template. + +```sql +EXEC snowflake.table.tables.create_table_using_template +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@query='{{ query }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }} +@@json= +'{ +"name": "{{ name }}" +}'; +``` + + + +Create a new table by cloning from the specified resource + +```sql +EXEC snowflake.table.tables.clone_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}' +@@json= +'{ +"name": "{{ name }}", +"kind": "{{ kind }}", +"cluster_by": "{{ cluster_by }}", +"enable_schema_evolution": {{ enable_schema_evolution }}, +"change_tracking": {{ change_tracking }}, +"data_retention_time_in_days": {{ data_retention_time_in_days }}, +"max_data_extension_time_in_days": {{ max_data_extension_time_in_days }}, +"default_ddl_collation": "{{ default_ddl_collation }}", +"columns": "{{ columns }}", +"constraints": "{{ constraints }}", +"comment": "{{ comment }}" +}'; +``` + + + +Create a new table like the specified resource, but empty + +```sql +EXEC snowflake.table.tables.create_table_like_deprecated +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@newTableName='{{ newTableName }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }}; +``` + + + +Create a new table like the specified resource, but empty + +```sql +EXEC snowflake.table.tables.create_table_like +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@createMode='{{ createMode }}', +@copyGrants={{ copyGrants }} +@@json= +'{ +"name": "{{ name }}" +}'; +``` + + + +Undrop specified table + +```sql +EXEC snowflake.table.tables.undrop_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Suspend recluster of a table + +```sql +EXEC snowflake.table.tables.suspend_recluster_table_deprecated +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Suspend recluster of a table + +```sql +EXEC snowflake.table.tables.suspend_recluster_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Resume recluster of a table + +```sql +EXEC snowflake.table.tables.resume_recluster_table_deprecated +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; ``` + + + +Resume recluster of a table + +```sql +EXEC snowflake.table.tables.resume_recluster_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Swap with another table + +```sql +EXEC snowflake.table.tables.swap_with_table_deprecated +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetTableName='{{ targetTableName }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Swap with another table + +```sql +EXEC snowflake.table.tables.swap_with_table +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@targetName='{{ targetName }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}, +@targetDatabase='{{ targetDatabase }}', +@targetSchema='{{ targetSchema }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/task/complete_graphs/index.md b/docs/snowflake-docs/providers/snowflake/task/complete_graphs/index.md index 8cf890a55..050e35404 100644 --- a/docs/snowflake-docs/providers/snowflake/task/complete_graphs/index.md +++ b/docs/snowflake-docs/providers/snowflake/task/complete_graphs/index.md @@ -1,4 +1,4 @@ ---- +--- title: complete_graphs hide_title: false hide_table_of_contents: false @@ -28,103 +28,331 @@ Creates, updates, deletes, gets or lists a complete_graphs resource ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | The time this task run was last completed. | -| | `string` | The name of the current database for the task run. | -| | `integer` | The first error code thrown in the task run. | -| | `string` | The first error message thrown in the task run. | -| | `string` | The name of the first task throwing an error in the task run. | -| | `integer` | The current version of the DAG on the task run. | -| | `string` | The next upcoming time for the task run. | -| | `string` | The start time for the task run query. | -| | `string` | The unique task ID for the root task. | -| | `string` | The name of the root task in the current task run. | -| | `integer` | The unique ID for the current task run. | -| | `string` | The scheduled time for the task run. | -| | `string` | The name of the current schema for the task run. | -| | `string` | The current state of the task run. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | , | This function returns details for graph runs that are completed. | -| | `SELECT` | | , | This function returns details for graph runs that are completed. | +The following fields are returned by `SELECT` queries: + + + + +A task run executing a standalone task or a DAG of tasks starting from the root task. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe unique task ID for the root task.
integerThe unique ID for the current task run.
stringThe name of the current database for the task run.
stringThe name of the first task throwing an error in the task run.
stringThe name of the root task in the current task run.
stringThe name of the current schema for the task run.
string (date-time)The time this task run was last completed.
integerThe first error code thrown in the task run.
stringThe first error message thrown in the task run.
integerThe current version of the DAG on the task run.
string (date-time)The next upcoming time for the task run.
string (date-time)The start time for the task run query.
string (date-time)The scheduled time for the task run.
stringThe current state of the task run.
+
+ + +A task run executing a standalone task or a DAG of tasks starting from the root task. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe unique task ID for the root task.
integerThe unique ID for the current task run.
stringThe name of the current database for the task run.
stringThe name of the first task throwing an error in the task run.
stringThe name of the root task in the current task run.
stringThe name of the current schema for the task run.
string (date-time)The time this task run was last completed.
integerThe first error code thrown in the task run.
stringThe first error message thrown in the task run.
integerThe current version of the DAG on the task run.
string (date-time)The next upcoming time for the task run.
string (date-time)The start time for the task run query.
string (date-time)The scheduled time for the task run.
stringThe current state of the task run.
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, name, endpointresultLimit, errorOnlyThis function returns details for graph runs that are completed.
database_name, schema_name, name, endpointresultLimit, errorOnlyThis function returns details for graph runs that are completed.
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Whether to only return results for tasks runs that have failed. Default is false. | `boolean` | `-` | -| | Number of results to return, at most. Default is 1000, valid range is 1 to 10000. | `integer` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanWhether to only return results for tasks runs that have failed. Default is false.
integerNumber of results to return, at most. Default is 1000, valid range is 1 to 10000.
## `SELECT` examples - + { label: 'get_complete_graphs_deprecated', value: 'get_complete_graphs_deprecated' }, + { label: 'get_complete_graphs', value: 'get_complete_graphs' } + ]} +> + This function returns details for graph runs that are completed. ```sql SELECT -completed_time, +root_task_id, +run_id, database_name, +first_error_task_name, +root_task_name, +schema_name, +completed_time, first_error_code, first_error_message, -first_error_task_name, graph_version, next_scheduled_time, query_start_time, -root_task_id, -root_task_name, -run_id, scheduled_time, -schema_name, state FROM snowflake.task.complete_graphs -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND resultLimit = '{{ resultLimit }}' +AND errorOnly = '{{ errorOnly }}'; ``` - + This function returns details for graph runs that are completed. ```sql SELECT -completed_time, +root_task_id, +run_id, database_name, +first_error_task_name, +root_task_name, +schema_name, +completed_time, first_error_code, first_error_message, -first_error_task_name, graph_version, next_scheduled_time, query_start_time, -root_task_id, -root_task_name, -run_id, scheduled_time, -schema_name, state FROM snowflake.task.complete_graphs -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND resultLimit = '{{ resultLimit }}' +AND errorOnly = '{{ errorOnly }}'; ``` diff --git a/docs/snowflake-docs/providers/snowflake/task/current_graphs/index.md b/docs/snowflake-docs/providers/snowflake/task/current_graphs/index.md index 1e0f07321..acfbdf596 100644 --- a/docs/snowflake-docs/providers/snowflake/task/current_graphs/index.md +++ b/docs/snowflake-docs/providers/snowflake/task/current_graphs/index.md @@ -1,4 +1,4 @@ ---- +--- title: current_graphs hide_title: false hide_table_of_contents: false @@ -28,102 +28,324 @@ Creates, updates, deletes, gets or lists a current_graphs resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | The time this task run was last completed. | -| | `string` | The name of the current database for the task run. | -| | `integer` | The first error code thrown in the task run. | -| | `string` | The first error message thrown in the task run. | -| | `string` | The name of the first task throwing an error in the task run. | -| | `integer` | The current version of the DAG on the task run. | -| | `string` | The next upcoming time for the task run. | -| | `string` | The start time for the task run query. | -| | `string` | The unique task ID for the root task. | -| | `string` | The name of the root task in the current task run. | -| | `integer` | The unique ID for the current task run. | -| | `string` | The scheduled time for the task run. | -| | `string` | The name of the current schema for the task run. | -| | `string` | The current state of the task run. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | This function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days. | -| | `SELECT` | | | This function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days. | +The following fields are returned by `SELECT` queries: + + + + +A task run executing a standalone task or a DAG of tasks starting from the root task. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe unique task ID for the root task.
integerThe unique ID for the current task run.
stringThe name of the current database for the task run.
stringThe name of the first task throwing an error in the task run.
stringThe name of the root task in the current task run.
stringThe name of the current schema for the task run.
string (date-time)The time this task run was last completed.
integerThe first error code thrown in the task run.
stringThe first error message thrown in the task run.
integerThe current version of the DAG on the task run.
string (date-time)The next upcoming time for the task run.
string (date-time)The start time for the task run query.
string (date-time)The scheduled time for the task run.
stringThe current state of the task run.
+
+ + +A task run executing a standalone task or a DAG of tasks starting from the root task. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe unique task ID for the root task.
integerThe unique ID for the current task run.
stringThe name of the current database for the task run.
stringThe name of the first task throwing an error in the task run.
stringThe name of the root task in the current task run.
stringThe name of the current schema for the task run.
string (date-time)The time this task run was last completed.
integerThe first error code thrown in the task run.
stringThe first error message thrown in the task run.
integerThe current version of the DAG on the task run.
string (date-time)The next upcoming time for the task run.
string (date-time)The start time for the task run query.
string (date-time)The scheduled time for the task run.
stringThe current state of the task run.
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, name, endpointresultLimitThis function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days.
database_name, schema_name, name, endpointresultLimitThis function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days.
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | - | `integer` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
integer
## `SELECT` examples - + { label: 'get_current_graphs_deprecated', value: 'get_current_graphs_deprecated' }, + { label: 'get_current_graphs', value: 'get_current_graphs' } + ]} +> + This function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days. ```sql SELECT -completed_time, +root_task_id, +run_id, database_name, +first_error_task_name, +root_task_name, +schema_name, +completed_time, first_error_code, first_error_message, -first_error_task_name, graph_version, next_scheduled_time, query_start_time, -root_task_id, -root_task_name, -run_id, scheduled_time, -schema_name, state FROM snowflake.task.current_graphs -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND resultLimit = '{{ resultLimit }}'; ``` - + This function returns details for graph runs that are currently executing or are next scheduled to run within the next 8 days. ```sql SELECT -completed_time, +root_task_id, +run_id, database_name, +first_error_task_name, +root_task_name, +schema_name, +completed_time, first_error_code, first_error_message, -first_error_task_name, graph_version, next_scheduled_time, query_start_time, -root_task_id, -root_task_name, -run_id, scheduled_time, -schema_name, state FROM snowflake.task.current_graphs -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND resultLimit = '{{ resultLimit }}'; ``` diff --git a/docs/snowflake-docs/providers/snowflake/task/dependents/index.md b/docs/snowflake-docs/providers/snowflake/task/dependents/index.md index eca80d98c..9552aa84c 100644 --- a/docs/snowflake-docs/providers/snowflake/task/dependents/index.md +++ b/docs/snowflake-docs/providers/snowflake/task/dependents/index.md @@ -1,4 +1,4 @@ ---- +--- title: dependents hide_title: false hide_table_of_contents: false @@ -28,70 +28,265 @@ Creates, updates, deletes, gets or lists a dependents resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | An ID for the current task. | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `boolean` | Specifies whether to allow multiple instances of the DAG to run concurrently. | -| | `string` | Specifies a comment for the task. | -| | `string` | Specifies a Boolean SQL expression condition; multiple conditions joined with AND/OR are supported | -| | `object` | Task Config | -| | `string` | The time the task was created on. | -| | `string` | The name of the parent database for the task. | -| | `string` | The SQL definition for the task. Any one of single SQL statement, call to stored procedure, or procedural logic using Snowflake scripting. | -| | `string` | Specifies the name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub. | -| | `string` | Specifies the name of the root task that the finalizer task is associated with. | -| | `string` | The time the task was last committed on. | -| | `string` | The time the task was last suspended on. | -| | `string` | The role that owns the task. | -| | `string` | The role type of the task owner. | -| | `array` | Specifies one or more predecessor tasks for the current task | -| | `object` | Specifies the schedule for periodically running the task. | -| | `string` | The name of the parent schema for the task. | -| | `string` | Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks. | -| | `string` | Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks. | -| | `object` | Session Parameters for the task at runtime. | -| | `string` | The state of the task. Must be one of started or suspended. | -| | `integer` | Specifies the number of consecutive failed task runs after which the current task is suspended automatically. | -| | `object` | A schedule for executing a task at specified intervals of minutes. | -| | `integer` | Root task settable only. Specifies the number of automatic task graph retry attempts. Valid range is 0 to 30. When not specified, no retry would happen. | -| | `string` | Displays the relationship between the root task and its corresponding finalizer tasks. | -| | `string` | Specifies the size of the compute resources to provision for the first run of the task. This parameter only applies to serverless tasks. | -| | `integer` | Specifies the time limit on a single run of the task before it times out (in milliseconds). | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | This operation returns a list of the dependent tasks of the task with identifier {name}. | +The following fields are returned by `SELECT` queries: + + + -
+A Snowflake task, used to execute SQL code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringAn ID for the current task.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe name of the parent database for the task.
stringThe name of the parent schema for the task.
booleanSpecifies whether to allow multiple instances of the DAG to run concurrently.
stringSpecifies a comment for the task.
stringSpecifies a Boolean SQL expression condition; multiple conditions joined with AND/OR are supported
objectTask Config
string (date-time)The time the task was created on.
stringThe SQL definition for the task. Any one of single SQL statement, call to stored procedure, or procedural logic using Snowflake scripting.
stringSpecifies the name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub.
stringSpecifies the name of the root task that the finalizer task is associated with.
string (date-time)The time the task was last committed on.
string (date-time)The time the task was last suspended on.
stringThe role that owns the task.
stringThe role type of the task owner.
arraySpecifies one or more predecessor tasks for the current task
objectSpecifies the schedule for periodically running the task.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks.
objectSession Parameters for the task at runtime.
stringThe state of the task. Must be one of started or suspended.
integerSpecifies the number of consecutive failed task runs after which the current task is suspended automatically.
objectSpecifies the schedule for periodically running the task.
integerRoot task settable only. Specifies the number of automatic task graph retry attempts. Valid range is 0 to 30. When not specified, no retry would happen.
stringDisplays the relationship between the root task and its corresponding finalizer tasks.
stringSpecifies the size of the compute resources to provision for the first run of the task. This parameter only applies to serverless tasks.
integerSpecifies the time limit on a single run of the task before it times out (in milliseconds).
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, name, endpointrecursiveThis operation returns a list of the dependent tasks of the task with identifier {name}.
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Specifies whether to limit the output to include only direct child tasks or to include all recursive child tasks. | `boolean` | `true` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanSpecifies whether to limit the output to include only direct child tasks or to include all recursive child tasks. (default: true)
## `SELECT` examples -This operation returns a list of the dependent tasks of the task with identifier {name}. + + +This operation returns a list of the dependent tasks of the task with identifier {name}. ```sql SELECT id, name, +database_name, +schema_name, allow_overlapping_execution, comment, condition, config, created_on, -database_name, definition, error_integration, finalize, @@ -101,7 +296,6 @@ owner, owner_role_type, predecessors, schedule, -schema_name, serverless_task_max_statement_size, serverless_task_min_statement_size, session_parameters, @@ -114,8 +308,11 @@ user_task_managed_initial_warehouse_size, user_task_timeout_ms, warehouse FROM snowflake.task.dependents -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; -``` \ No newline at end of file +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND recursive = '{{ recursive }}'; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/task/tasks/index.md b/docs/snowflake-docs/providers/snowflake/task/tasks/index.md index 59cf8d998..9819aeaa6 100644 --- a/docs/snowflake-docs/providers/snowflake/task/tasks/index.md +++ b/docs/snowflake-docs/providers/snowflake/task/tasks/index.md @@ -1,4 +1,4 @@ ---- +--- title: tasks hide_title: false hide_table_of_contents: false @@ -28,69 +28,492 @@ Creates, updates, deletes, gets or lists a tasks resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | An ID for the current task. | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `boolean` | Specifies whether to allow multiple instances of the DAG to run concurrently. | -| | `string` | Specifies a comment for the task. | -| | `string` | Specifies a Boolean SQL expression condition; multiple conditions joined with AND/OR are supported | -| | `object` | Task Config | -| | `string` | The time the task was created on. | -| | `string` | The name of the parent database for the task. | -| | `string` | The SQL definition for the task. Any one of single SQL statement, call to stored procedure, or procedural logic using Snowflake scripting. | -| | `string` | Specifies the name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub. | -| | `string` | Specifies the name of the root task that the finalizer task is associated with. | -| | `string` | The time the task was last committed on. | -| | `string` | The time the task was last suspended on. | -| | `string` | The role that owns the task. | -| | `string` | The role type of the task owner. | -| | `array` | Specifies one or more predecessor tasks for the current task | -| | `object` | Specifies the schedule for periodically running the task. | -| | `string` | The name of the parent schema for the task. | -| | `string` | Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks. | -| | `string` | Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks. | -| | `object` | Session Parameters for the task at runtime. | -| | `string` | The state of the task. Must be one of started or suspended. | -| | `integer` | Specifies the number of consecutive failed task runs after which the current task is suspended automatically. | -| | `object` | A schedule for executing a task at specified intervals of minutes. | -| | `integer` | Root task settable only. Specifies the number of automatic task graph retry attempts. Valid range is 0 to 30. When not specified, no retry would happen. | -| | `string` | Displays the relationship between the root task and its corresponding finalizer tasks. | -| | `string` | Specifies the size of the compute resources to provision for the first run of the task. This parameter only applies to serverless tasks. | -| | `integer` | Specifies the time limit on a single run of the task before it times out (in milliseconds). | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake task, used to execute SQL code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringAn ID for the current task.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe name of the parent database for the task.
stringThe name of the parent schema for the task.
booleanSpecifies whether to allow multiple instances of the DAG to run concurrently.
stringSpecifies a comment for the task.
stringSpecifies a Boolean SQL expression condition; multiple conditions joined with AND/OR are supported
objectTask Config
string (date-time)The time the task was created on.
stringThe SQL definition for the task. Any one of single SQL statement, call to stored procedure, or procedural logic using Snowflake scripting.
stringSpecifies the name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub.
stringSpecifies the name of the root task that the finalizer task is associated with.
string (date-time)The time the task was last committed on.
string (date-time)The time the task was last suspended on.
stringThe role that owns the task.
stringThe role type of the task owner.
arraySpecifies one or more predecessor tasks for the current task
objectSpecifies the schedule for periodically running the task.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks.
objectSession Parameters for the task at runtime.
stringThe state of the task. Must be one of started or suspended.
integerSpecifies the number of consecutive failed task runs after which the current task is suspended automatically.
objectSpecifies the schedule for periodically running the task.
integerRoot task settable only. Specifies the number of automatic task graph retry attempts. Valid range is 0 to 30. When not specified, no retry would happen.
stringDisplays the relationship between the root task and its corresponding finalizer tasks.
stringSpecifies the size of the compute resources to provision for the first run of the task. This parameter only applies to serverless tasks.
integerSpecifies the time limit on a single run of the task before it times out (in milliseconds).
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
+
+ + +A Snowflake task, used to execute SQL code. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringAn ID for the current task.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringThe name of the parent database for the task.
stringThe name of the parent schema for the task.
booleanSpecifies whether to allow multiple instances of the DAG to run concurrently.
stringSpecifies a comment for the task.
stringSpecifies a Boolean SQL expression condition; multiple conditions joined with AND/OR are supported
objectTask Config
string (date-time)The time the task was created on.
stringThe SQL definition for the task. Any one of single SQL statement, call to stored procedure, or procedural logic using Snowflake scripting.
stringSpecifies the name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub.
stringSpecifies the name of the root task that the finalizer task is associated with.
string (date-time)The time the task was last committed on.
string (date-time)The time the task was last suspended on.
stringThe role that owns the task.
stringThe role type of the task owner.
arraySpecifies one or more predecessor tasks for the current task
objectSpecifies the schedule for periodically running the task.
stringSpecifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks.
stringSpecifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks.
objectSession Parameters for the task at runtime.
stringThe state of the task. Must be one of started or suspended.
integerSpecifies the number of consecutive failed task runs after which the current task is suspended automatically.
objectSpecifies the schedule for periodically running the task.
integerRoot task settable only. Specifies the number of automatic task graph retry attempts. Valid range is 0 to 30. When not specified, no retry would happen.
stringDisplays the relationship between the root task and its corresponding finalizer tasks.
stringSpecifies the size of the compute resources to provision for the first run of the task. This parameter only applies to serverless tasks.
integerSpecifies the time limit on a single run of the task before it times out (in milliseconds).
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a task using the describe command output. | -| | `SELECT` | | , , , , | Lists tasks under the database and schema, with show options as query parameters. | -| | `INSERT` | | | Create a task, with standard create modifiers as query parameters. See the Task component definition for what is required to be provided in the request body. | -| | `DELETE` | | | Delete a task with the task name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful. | -| | `REPLACE` | | - | Create a (or alter an existing) task. Even if the operation is just an alter, the full property set must be provided. | -| | `EXEC` | | , | Execute a task -- this is equivalent to EXECUTE IMMEDIATE. | -| | `EXEC` | | - | Resumes a suspended task object. This is equivalento an ALTER TASK ... RESUME. | -| | `EXEC` | | - | Suspends a running task. This is equivalent to an ALTER TASK ... SUSPEND. | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Asynchronous execution enable/disable. Default is disable. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Retry the last failed run of the DAG. | `boolean` | `false` | -| | Query parameter to filter the command output to return only root resources (resources with no predecessors). | `boolean` | `false` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointrootOnly, like, startsWith, showLimit, fromNameLists tasks under the database and schema, with show options as query parameters.
database_name, schema_name, name, endpointFetch a task using the describe command output.
database_name, schema_name, endpointcreateModeCreate a task, with standard create modifiers as query parameters. See the Task component definition for what is required to be provided in the request body.
database_name, schema_name, name, endpointCreate a (or alter an existing) task. Even if the operation is just an alter, the full property set must be provided.
database_name, schema_name, name, endpointifExistsDelete a task with the task name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful.
database_name, schema_name, name, endpointasyncExec, retryLastExecute a task -- this is equivalent to EXECUTE IMMEDIATE.
database_name, schema_name, name, endpointResumes a suspended task object. This is equivalento an ALTER TASK ... RESUME.
database_name, schema_name, name, endpointSuspends a running task. This is equivalent to an ALTER TASK ... SUSPEND.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanAsynchronous execution enable/disable. Default is disable. (default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
booleanRetry the last failed run of the DAG. (default: false)
booleanQuery parameter to filter the command output to return only root resources (resources with no predecessors). (example: false, default: false)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -99,8 +522,8 @@ Creates, updates, deletes, gets or lists a tasks resource. values={[ { label: 'list_tasks', value: 'list_tasks' }, { label: 'fetch_task', value: 'fetch_task' } - ] -}> + ]} +> Lists tasks under the database and schema, with show options as query parameters. @@ -109,12 +532,13 @@ Lists tasks under the database and schema, with show options as query parameters SELECT id, name, +database_name, +schema_name, allow_overlapping_execution, comment, condition, config, created_on, -database_name, definition, error_integration, finalize, @@ -124,7 +548,6 @@ owner, owner_role_type, predecessors, schedule, -schema_name, serverless_task_max_statement_size, serverless_task_min_statement_size, session_parameters, @@ -137,9 +560,14 @@ user_task_managed_initial_warehouse_size, user_task_timeout_ms, warehouse FROM snowflake.task.tasks -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND rootOnly = '{{ rootOnly }}' +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` @@ -150,12 +578,13 @@ Fetch a task using the describe command output. SELECT id, name, +database_name, +schema_name, allow_overlapping_execution, comment, condition, config, created_on, -database_name, definition, error_integration, finalize, @@ -165,7 +594,6 @@ owner, owner_role_type, predecessors, schedule, -schema_name, serverless_task_max_statement_size, serverless_task_min_statement_size, session_parameters, @@ -178,30 +606,29 @@ user_task_managed_initial_warehouse_size, user_task_timeout_ms, warehouse FROM snowflake.task.tasks -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a task, with standard create modifiers as query parameters. See the Task component definition for what is required to be provided in the request body. +## `INSERT` examples - + { label: 'create_task', value: 'create_task' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a task, with standard create modifiers as query parameters. See the Task component definition for what is required to be provided in the request body. ```sql -/*+ create */ INSERT INTO snowflake.task.tasks ( data__name, data__warehouse, @@ -224,7 +651,8 @@ data__allow_overlapping_execution, data__error_integration, database_name, schema_name, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -248,36 +676,15 @@ SELECT '{{ error_integration }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.task.tasks ( -data__name, -data__definition, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ definition }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: tasks props: - name: database_name @@ -291,145 +698,223 @@ SELECT description: Required parameter for the tasks resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the tasks resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: warehouse value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: schedule - value: - schedule_type: string - description: Specifies the schedule for periodically running the task. + value: object + description: > + Specifies the schedule for periodically running the task. + - name: comment value: string - description: Specifies a comment for the task. + description: > + Specifies a comment for the task. + - name: finalize value: string - description: >- - Specifies the name of the root task that the finalizer task is - associated with. + description: > + Specifies the name of the root task that the finalizer task is associated with. + - name: task_auto_retry_attempts value: integer - description: >- - Root task settable only. Specifies the number of automatic task graph - retry attempts. Valid range is 0 to 30. When not specified, no retry - would happen. + description: > + Root task settable only. Specifies the number of automatic task graph retry attempts. Valid range is 0 to 30. When not specified, no retry would happen. + - name: config value: object - description: Task Config + description: > + Task Config + - name: session_parameters value: object - description: Session Parameters for the task at runtime. + description: > + Session Parameters for the task at runtime. + - name: definition value: string - description: >- - The SQL definition for the task. Any one of single SQL statement, call - to stored procedure, or procedural logic using Snowflake scripting. - (Required parameter for the tasks resource.) + description: > + The SQL definition for the task. Any one of single SQL statement, call to stored procedure, or procedural logic using Snowflake scripting. + - name: predecessors value: array - description: Specifies one or more predecessor tasks for the current task + description: > + Specifies one or more predecessor tasks for the current task + - name: user_task_managed_initial_warehouse_size value: string - description: >- - Specifies the size of the compute resources to provision for the first - run of the task. This parameter only applies to serverless tasks. + description: > + Specifies the size of the compute resources to provision for the first run of the task. This parameter only applies to serverless tasks. + - name: target_completion_interval - value: - schedule_type: string - description: Specifies the schedule for periodically running the task. + value: object + description: > + Specifies the schedule for periodically running the task. + - name: serverless_task_min_statement_size value: string - description: >- - Specifies the minimum allowed warehouse size for the serverless task. - Minimum XSMALL, Maximum XXLARGE. This parameter only applies to - serverless tasks. + description: > + Specifies the minimum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks. + - name: serverless_task_max_statement_size value: string - description: >- - Specifies the maximum allowed warehouse size for the serverless task. - Minimum XSMALL, Maximum XXLARGE. This parameter only applies to - serverless tasks. + description: > + Specifies the maximum allowed warehouse size for the serverless task. Minimum XSMALL, Maximum XXLARGE. This parameter only applies to serverless tasks. + - name: user_task_timeout_ms value: integer - description: >- - Specifies the time limit on a single run of the task before it times out - (in milliseconds). + description: > + Specifies the time limit on a single run of the task before it times out (in milliseconds). + - name: suspend_task_after_num_failures value: integer - description: >- - Specifies the number of consecutive failed task runs after which the - current task is suspended automatically. + description: > + Specifies the number of consecutive failed task runs after which the current task is suspended automatically. + - name: condition value: string - description: >- - Specifies a Boolean SQL expression condition; multiple conditions joined - with AND/OR are supported + description: > + Specifies a Boolean SQL expression condition; multiple conditions joined with AND/OR are supported + - name: allow_overlapping_execution value: boolean - description: >- - Specifies whether to allow multiple instances of the DAG to run - concurrently. + description: > + Specifies whether to allow multiple instances of the DAG to run concurrently. + - name: error_integration value: string - description: >- - Specifies the name of the notification integration used to communicate - with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub. + description: > + Specifies the name of the notification integration used to communicate with Amazon SNS, MS Azure Event Grid, or Google Pub/Sub. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `REPLACE` example + +## `REPLACE` examples + + + Create a (or alter an existing) task. Even if the operation is just an alter, the full property set must be provided. ```sql -/*+ update */ REPLACE snowflake.task.tasks SET -name = '{{ name }}', -warehouse = '{{ warehouse }}', -schedule = '{{ schedule }}', -comment = '{{ comment }}', -finalize = '{{ finalize }}', -task_auto_retry_attempts = {{ task_auto_retry_attempts }}, -config = '{{ config }}', -session_parameters = '{{ session_parameters }}', -definition = '{{ definition }}', -predecessors = '{{ predecessors }}', -user_task_managed_initial_warehouse_size = '{{ user_task_managed_initial_warehouse_size }}', -target_completion_interval = '{{ target_completion_interval }}', -serverless_task_min_statement_size = '{{ serverless_task_min_statement_size }}', -serverless_task_max_statement_size = '{{ serverless_task_max_statement_size }}', -user_task_timeout_ms = {{ user_task_timeout_ms }}, -suspend_task_after_num_failures = {{ suspend_task_after_num_failures }}, -condition = '{{ condition }}', -allow_overlapping_execution = {{ allow_overlapping_execution }}, -error_integration = '{{ error_integration }}' +data__name = '{{ name }}', +data__warehouse = '{{ warehouse }}', +data__schedule = '{{ schedule }}', +data__comment = '{{ comment }}', +data__finalize = '{{ finalize }}', +data__task_auto_retry_attempts = {{ task_auto_retry_attempts }}, +data__config = '{{ config }}', +data__session_parameters = '{{ session_parameters }}', +data__definition = '{{ definition }}', +data__predecessors = '{{ predecessors }}', +data__user_task_managed_initial_warehouse_size = '{{ user_task_managed_initial_warehouse_size }}', +data__target_completion_interval = '{{ target_completion_interval }}', +data__serverless_task_min_statement_size = '{{ serverless_task_min_statement_size }}', +data__serverless_task_max_statement_size = '{{ serverless_task_max_statement_size }}', +data__user_task_timeout_ms = {{ user_task_timeout_ms }}, +data__suspend_task_after_num_failures = {{ suspend_task_after_num_failures }}, +data__condition = '{{ condition }}', +data__allow_overlapping_execution = {{ allow_overlapping_execution }}, +data__error_integration = '{{ error_integration }}' WHERE -database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND data__definition = '{{ data__definition }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required +AND data__definition = '{{ definition }}' --required; ``` + + -## `DELETE` example + +## `DELETE` examples + + + Delete a task with the task name. If ifExists is used, the operation will succeed even if the object does not exist. Otherwise, there will be a failure if the drop is unsuccessful. ```sql -/*+ delete */ DELETE FROM snowflake.task.tasks -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Execute a task -- this is equivalent to EXECUTE IMMEDIATE. + +```sql +EXEC snowflake.task.tasks.execute_task +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@asyncExec={{ asyncExec }}, +@retryLast={{ retryLast }}; +``` + + + +Resumes a suspended task object. This is equivalento an ALTER TASK ... RESUME. + +```sql +EXEC snowflake.task.tasks.resume_task +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; ``` + + + +Suspends a running task. This is equivalent to an ALTER TASK ... SUSPEND. + +```sql +EXEC snowflake.task.tasks.suspend_task +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + diff --git a/docs/snowflake-docs/providers/snowflake/user/grants/index.md b/docs/snowflake-docs/providers/snowflake/user/grants/index.md index 438dba224..cd6a863b0 100644 --- a/docs/snowflake-docs/providers/snowflake/user/grants/index.md +++ b/docs/snowflake-docs/providers/snowflake/user/grants/index.md @@ -1,4 +1,4 @@ ---- +--- title: grants hide_title: false hide_table_of_contents: false @@ -28,38 +28,142 @@ Creates, updates, deletes, gets or lists a grants resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `object` | | -| | `string` | Date and time when the grant was created | -| | `string` | The role that granted this privilege to this grantee | -| | `array` | List of privileges to be granted. | -| | `object` | | -| | `string` | Type of the securable to be granted. Only ROLE is supported | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | | List all grants to the user | -| | `INSERT` | | - | Grant a role to the user | -| | `DELETE` | | - | Revoke grants from the user | +The following fields are returned by `SELECT` queries: -
+ + +successful -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
object
string (date-time)Date and time when the grant was created
stringThe role that granted this privilege to this grantee
arrayList of privileges to be granted.
object
stringType of the securable to be granted. Only ROLE is supported
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | +## Methods + +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
name, endpointshowLimitList all grants to the user
name, endpointGrant a role to the user
name, endpointRevoke grants from the user
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
## `SELECT` examples -List all grants to the user + + +List all grants to the user ```sql SELECT @@ -70,25 +174,28 @@ privileges, securable, securable_type FROM snowflake.user.grants -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND showLimit = '{{ showLimit }}'; ``` -## `INSERT` example + + -Grant a role to the user + +## `INSERT` examples - + { label: 'grant', value: 'grant' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Grant a role to the user ```sql -/*+ create */ INSERT INTO snowflake.user.grants ( data__securable, data__containing_scope, @@ -107,28 +214,10 @@ SELECT ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.user.grants ( -data__securable_type, -name, -endpoint -) -SELECT -'{{ securable_type }}', -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: grants props: - name: name @@ -138,34 +227,40 @@ SELECT value: string description: Required parameter for the grants resource. - name: securable - value: - database: string - schema: string - name: string + value: object - name: containing_scope - value: - database: string - schema: string + value: object - name: securable_type value: string - description: >- - Type of the securable to be granted. Only ROLE is supported (Required - parameter for the grants resource.) + description: > + Type of the securable to be granted. Only ROLE is supported + - name: privileges value: array - description: List of privileges to be granted. + description: > + List of privileges to be granted. + ``` -## `DELETE` example + +## `DELETE` examples + + + Revoke grants from the user ```sql -/*+ delete */ DELETE FROM snowflake.user.grants -WHERE name = '{{ name }}' -AND data__securable_type = '{{ data__securable_type }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/user/users/index.md b/docs/snowflake-docs/providers/snowflake/user/users/index.md index fa286bfc7..2e931cb6e 100644 --- a/docs/snowflake-docs/providers/snowflake/user/users/index.md +++ b/docs/snowflake-docs/providers/snowflake/user/users/index.md @@ -1,4 +1,4 @@ ---- +--- title: users hide_title: false hide_table_of_contents: false @@ -28,74 +28,556 @@ Creates, updates, deletes, gets or lists a users resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | User name | -| | `string` | Comment about the user. | -| | `string` | | -| | `string` | | -| | `boolean` | Whether or not to flush the custom landing page of the user on next UI load | -| | `integer` | How many days until this user expires | -| | `string` | The default namespace to use when this user starts a session | -| | `string` | The default role to use when this user starts a session | -| | `string` | The default secondary roles of this user to use when starting a session. Only valid set values are ALL or NONE. Default is ALL after 2024-07 BCR. | -| | `string` | The default warehouse to use when this user starts a session | -| | `boolean` | Has this user been disabled from the system | -| | `string` | Display name | -| | `string` | Email address | -| | `boolean` | Whether to show unredacted query syntax errors in the query history. | -| | `string` | | -| | `boolean` | | -| | `string` | | -| | `string` | First name | -| | `boolean` | | -| | `boolean` | | -| | `string` | Last name | -| | `string` | | -| | `string` | | -| | `string` | Login name | -| | `string` | Middle name | -| | `integer` | How many minutes until MFA is required again | -| | `integer` | Temporary bypass network policy on the user for a specified number of minutes | -| | `integer` | How many minutes until the account is unlocked after multiple failed logins | -| | `boolean` | Does this user need to change their password (e.g., after assigning a temp password) | -| | `string` | Specifies an existing network policy is active for the user. Otherwise, use account default. | -| | `string` | | -| | `string` | Password | -| | `string` | | -| | `string` | RSA public key of the user | -| | `string` | Second RSA public key of the user | -| | `string` | Fingerprint of the user's second RSA public key | -| | `string` | Fingerprint of the user's RSA public key | -| | `boolean` | Whether the user, account, or organization is locked by Snowflake. | -| | `boolean` | Whether Snowflake Support is allowed to use the user or account | -| | `string` | Indicates the type of user (PERSON \| SERVICE \| LEGACY_SERVICE) | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch user information using the result of the DESCRIBE command | -| | `SELECT` | | , , , | Lists the users in the system. | -| | `INSERT` | | | Create a user according to the parameters given | -| | `DELETE` | | | Delete a user with the given name. | -| | `REPLACE` | | - | Create a (or alter an existing) user. Even if the operation is just an alter, the full property set must be provided. Note that password is not currently altered by this operation but is supported for a newly-created object. | +The following fields are returned by `SELECT` queries: + + + -
+Properties of user. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringUser name (example: jackpatel)
stringDisplay name
stringFirst name
stringLast name
stringLogin name
stringMiddle name
stringComment about the user. (example: A distinguished user)
string (date-time)
string
booleanWhether or not to flush the custom landing page of the user on next UI load
integerHow many days until this user expires
stringThe default namespace to use when this user starts a session
stringThe default role to use when this user starts a session
stringThe default secondary roles of this user to use when starting a session. Only valid set values are ALL or NONE. Default is ALL after 2024-07 BCR. (default: ALL)
stringThe default warehouse to use when this user starts a session
booleanHas this user been disabled from the system
stringEmail address
booleanWhether to show unredacted query syntax errors in the query history.
string (date-time)
boolean
string
boolean
boolean
string (date-time)
string (date-time)
integerHow many minutes until MFA is required again
integerTemporary bypass network policy on the user for a specified number of minutes
integerHow many minutes until the account is unlocked after multiple failed logins
booleanDoes this user need to change their password (e.g., after assigning a temp password)
stringSpecifies an existing network policy is active for the user. Otherwise, use account default.
string
string (password)Password
string (date-time)
stringRSA public key of the user
stringSecond RSA public key of the user
stringFingerprint of the user's second RSA public key
stringFingerprint of the user's RSA public key
booleanWhether the user, account, or organization is locked by Snowflake.
booleanWhether Snowflake Support is allowed to use the user or account
stringIndicates the type of user (PERSON | SERVICE | LEGACY_SERVICE)
+
+ + +Properties of user. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringUser name (example: jackpatel)
stringDisplay name
stringFirst name
stringLast name
stringLogin name
stringMiddle name
stringComment about the user. (example: A distinguished user)
string (date-time)
string
booleanWhether or not to flush the custom landing page of the user on next UI load
integerHow many days until this user expires
stringThe default namespace to use when this user starts a session
stringThe default role to use when this user starts a session
stringThe default secondary roles of this user to use when starting a session. Only valid set values are ALL or NONE. Default is ALL after 2024-07 BCR. (default: ALL)
stringThe default warehouse to use when this user starts a session
booleanHas this user been disabled from the system
stringEmail address
booleanWhether to show unredacted query syntax errors in the query history.
string (date-time)
boolean
string
boolean
boolean
string (date-time)
string (date-time)
integerHow many minutes until MFA is required again
integerTemporary bypass network policy on the user for a specified number of minutes
integerHow many minutes until the account is unlocked after multiple failed logins
booleanDoes this user need to change their password (e.g., after assigning a temp password)
stringSpecifies an existing network policy is active for the user. Otherwise, use account default.
string
string (password)Password
string (date-time)
stringRSA public key of the user
stringSecond RSA public key of the user
stringFingerprint of the user's second RSA public key
stringFingerprint of the user's RSA public key
booleanWhether the user, account, or organization is locked by Snowflake.
booleanWhether Snowflake Support is allowed to use the user or account
stringIndicates the type of user (PERSON | SERVICE | LEGACY_SERVICE)
+
+
+ +## Methods -
-Optional Parameter Details +The following methods are available for this resource: -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlike, startsWith, showLimit, fromNameLists the users in the system.
name, endpointFetch user information using the result of the DESCRIBE command
endpointcreateModeCreate a user according to the parameters given
name, endpointCreate a (or alter an existing) user. Even if the operation is just an alter, the full property set must be provided. Note that password is not currently altered by this operation but is supported for a newly-created object.
name, endpointifExistsDelete a user with the given name.
## Parameters -
+Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -104,8 +586,8 @@ Creates, updates, deletes, gets or lists a users resource. values={[ { label: 'list_users', value: 'list_users' }, { label: 'fetch_user', value: 'fetch_user' } - ] -}> + ]} +> Lists the users in the system. @@ -113,6 +595,11 @@ Lists the users in the system. ```sql SELECT name, +display_name, +first_name, +last_name, +login_name, +middle_name, comment, created_on, custom_landing_page_url, @@ -123,20 +610,15 @@ default_role, default_secondary_roles, default_warehouse, disabled, -display_name, email, enable_unredacted_query_syntax_error, expires_at, ext_authn_duo, ext_authn_uid, -first_name, has_password, has_rsa_public_key, -last_name, last_successful_login, locked_until, -login_name, -middle_name, mins_to_bypass_mfa, mins_to_bypass_network_policy, mins_to_unlock, @@ -153,7 +635,11 @@ snowflake_lock, snowflake_support, type FROM snowflake.user.users -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}'; ``` @@ -163,6 +649,11 @@ Fetch user information using the result of the DESCRIBE command ```sql SELECT name, +display_name, +first_name, +last_name, +login_name, +middle_name, comment, created_on, custom_landing_page_url, @@ -173,20 +664,15 @@ default_role, default_secondary_roles, default_warehouse, disabled, -display_name, email, enable_unredacted_query_syntax_error, expires_at, ext_authn_duo, ext_authn_uid, -first_name, has_password, has_rsa_public_key, -last_name, last_successful_login, locked_until, -login_name, -middle_name, mins_to_bypass_mfa, mins_to_bypass_network_policy, mins_to_unlock, @@ -203,28 +689,27 @@ snowflake_lock, snowflake_support, type FROM snowflake.user.users -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a user according to the parameters given +## `INSERT` examples - + { label: 'create_user', value: 'create_user' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a user according to the parameters given ```sql -/*+ create */ INSERT INTO snowflake.user.users ( data__name, data__password, @@ -249,7 +734,8 @@ data__comment, data__type, data__enable_unredacted_query_syntax_error, data__network_policy, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -275,30 +761,15 @@ SELECT '{{ type }}', {{ enable_unredacted_query_syntax_error }}, '{{ network_policy }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.user.users ( -data__name, -endpoint -) -SELECT -'{{ name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: users props: - name: endpoint @@ -306,131 +777,193 @@ SELECT description: Required parameter for the users resource. - name: name value: string - description: User name (Required parameter for the users resource.) + description: > + User name + - name: password value: string - description: Password + description: > + Password + - name: login_name value: string - description: Login name + description: > + Login name + - name: display_name value: string - description: Display name + description: > + Display name + - name: first_name value: string - description: First name + description: > + First name + - name: middle_name value: string - description: Middle name + description: > + Middle name + - name: last_name value: string - description: Last name + description: > + Last name + - name: email value: string - description: Email address + description: > + Email address + - name: must_change_password value: boolean - description: >- - Does this user need to change their password (e.g., after assigning a - temp password) + description: > + Does this user need to change their password (e.g., after assigning a temp password) + - name: disabled value: boolean - description: Has this user been disabled from the system + description: > + Has this user been disabled from the system + - name: days_to_expiry value: integer - description: How many days until this user expires + description: > + How many days until this user expires + - name: mins_to_unlock value: integer - description: >- - How many minutes until the account is unlocked after multiple failed - logins + description: > + How many minutes until the account is unlocked after multiple failed logins + - name: default_warehouse value: string - description: The default warehouse to use when this user starts a session + description: > + The default warehouse to use when this user starts a session + - name: default_namespace value: string - description: The default namespace to use when this user starts a session + description: > + The default namespace to use when this user starts a session + - name: default_role value: string - description: The default role to use when this user starts a session + description: > + The default role to use when this user starts a session + - name: default_secondary_roles value: string - description: >- - The default secondary roles of this user to use when starting a session. - Only valid set values are ALL or NONE. Default is ALL after 2024-07 BCR. - (valid values: 'ALL', 'NONE') + description: > + The default secondary roles of this user to use when starting a session. Only valid set values are ALL or NONE. Default is ALL after 2024-07 BCR. + + valid_values: ['ALL', 'NONE'] default: ALL - name: mins_to_bypass_mfa value: integer - description: How many minutes until MFA is required again + description: > + How many minutes until MFA is required again + - name: rsa_public_key value: string - description: RSA public key of the user + description: > + RSA public key of the user + - name: rsa_public_key_2 value: string - description: Second RSA public key of the user + description: > + Second RSA public key of the user + - name: comment value: string - description: Comment about the user. + description: > + Comment about the user. + - name: type value: string - description: Indicates the type of user (PERSON \| SERVICE \| LEGACY_SERVICE) + description: > + Indicates the type of user (PERSON | SERVICE | LEGACY_SERVICE) + - name: enable_unredacted_query_syntax_error value: boolean - description: Whether to show unredacted query syntax errors in the query history. + description: > + Whether to show unredacted query syntax errors in the query history. + - name: network_policy value: string - description: >- - Specifies an existing network policy is active for the user. Otherwise, - use account default. + description: > + Specifies an existing network policy is active for the user. Otherwise, use account default. + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `REPLACE` example + +## `REPLACE` examples + + + Create a (or alter an existing) user. Even if the operation is just an alter, the full property set must be provided. Note that password is not currently altered by this operation but is supported for a newly-created object. ```sql -/*+ update */ REPLACE snowflake.user.users SET -name = '{{ name }}', -password = '{{ password }}', -login_name = '{{ login_name }}', -display_name = '{{ display_name }}', -first_name = '{{ first_name }}', -middle_name = '{{ middle_name }}', -last_name = '{{ last_name }}', -email = '{{ email }}', -must_change_password = {{ must_change_password }}, -disabled = {{ disabled }}, -days_to_expiry = {{ days_to_expiry }}, -mins_to_unlock = {{ mins_to_unlock }}, -default_warehouse = '{{ default_warehouse }}', -default_namespace = '{{ default_namespace }}', -default_role = '{{ default_role }}', -default_secondary_roles = '{{ default_secondary_roles }}', -mins_to_bypass_mfa = {{ mins_to_bypass_mfa }}, -rsa_public_key = '{{ rsa_public_key }}', -rsa_public_key_2 = '{{ rsa_public_key_2 }}', -comment = '{{ comment }}', -type = '{{ type }}', -enable_unredacted_query_syntax_error = {{ enable_unredacted_query_syntax_error }}, -network_policy = '{{ network_policy }}' +data__name = '{{ name }}', +data__password = '{{ password }}', +data__login_name = '{{ login_name }}', +data__display_name = '{{ display_name }}', +data__first_name = '{{ first_name }}', +data__middle_name = '{{ middle_name }}', +data__last_name = '{{ last_name }}', +data__email = '{{ email }}', +data__must_change_password = {{ must_change_password }}, +data__disabled = {{ disabled }}, +data__days_to_expiry = {{ days_to_expiry }}, +data__mins_to_unlock = {{ mins_to_unlock }}, +data__default_warehouse = '{{ default_warehouse }}', +data__default_namespace = '{{ default_namespace }}', +data__default_role = '{{ default_role }}', +data__default_secondary_roles = '{{ default_secondary_roles }}', +data__mins_to_bypass_mfa = {{ mins_to_bypass_mfa }}, +data__rsa_public_key = '{{ rsa_public_key }}', +data__rsa_public_key_2 = '{{ rsa_public_key_2 }}', +data__comment = '{{ comment }}', +data__type = '{{ type }}', +data__enable_unredacted_query_syntax_error = {{ enable_unredacted_query_syntax_error }}, +data__network_policy = '{{ network_policy }}' WHERE -name = '{{ name }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required; ``` + + + + +## `DELETE` examples -## `DELETE` example + + Delete a user with the given name. ```sql -/*+ delete */ DELETE FROM snowflake.user.users -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/user_defined_function/user_defined_functions/index.md b/docs/snowflake-docs/providers/snowflake/user_defined_function/user_defined_functions/index.md index 66f3d77d6..07548e5f5 100644 --- a/docs/snowflake-docs/providers/snowflake/user_defined_function/user_defined_functions/index.md +++ b/docs/snowflake-docs/providers/snowflake/user_defined_function/user_defined_functions/index.md @@ -1,4 +1,4 @@ ---- +--- title: user_defined_functions hide_title: false hide_table_of_contents: false @@ -28,52 +28,371 @@ Creates, updates, deletes, gets or lists a user_defined_functions r ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | The name of the UDF | -| | `array` | List of arguments for the function/procedure | -| | `string` | Function/procedure definition | -| | `string` | Specifies a comment for the function/procedure | -| | `string` | The date and time when the function/procedure was created | -| | `string` | The name of the database in which the function/procedure exists. | -| | `boolean` | Specifies whether the UDF is an aggregate function. Applicable only for Python language type | -| | `boolean` | If the function/procedure is built-in or not (user-defined) | -| | `boolean` | Indicates whether the function is memoizable. Applicable only for Python language type. | -| | `boolean` | Specifies whether the function/procedure is secure or not | -| | `boolean` | True if the UDF is a table function; false otherwise. | -| | `boolean` | Specifies whether the UDF is temporary or not | -| | `object` | | -| | `integer` | The maximum number of arguments | -| | `integer` | The minimum number of arguments | -| | `string` | Role that owns the function/procedure | -| | `string` | The type of role that owns the function/procedure | -| | `object` | | -| | `string` | The name of the schema in which the function/procedure exists. | -| | `boolean` | True if the UDF is valid for clustering; false otherwise. | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a UDF | -| | `SELECT` | | | List UDFs | -| | `INSERT` | | , | Create a UDF | -| | `DELETE` | | | Delete a UDF | -| | `EXEC` | | | Rename a UDF | +The following fields are returned by `SELECT` queries: + + + -
+A snowflake UDF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe name of the UDF (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the database in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the schema in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayList of arguments for the function/procedure
stringFunction/procedure definition
stringSpecifies a comment for the function/procedure
string (date-time)The date and time when the function/procedure was created
booleanSpecifies whether the UDF is an aggregate function. Applicable only for Python language type
booleanIf the function/procedure is built-in or not (user-defined)
booleanIndicates whether the function is memoizable. Applicable only for Python language type.
booleanSpecifies whether the function/procedure is secure or not
booleanTrue if the UDF is a table function; false otherwise.
booleanSpecifies whether the UDF is temporary or not
object
integerThe maximum number of arguments
integerThe minimum number of arguments
stringRole that owns the function/procedure (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the function/procedure (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
object
booleanTrue if the UDF is valid for clustering; false otherwise.
+
+ + +A snowflake UDF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringThe name of the UDF (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the database in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe name of the schema in which the function/procedure exists. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
arrayList of arguments for the function/procedure
stringFunction/procedure definition
stringSpecifies a comment for the function/procedure
string (date-time)The date and time when the function/procedure was created
booleanSpecifies whether the UDF is an aggregate function. Applicable only for Python language type
booleanIf the function/procedure is built-in or not (user-defined)
booleanIndicates whether the function is memoizable. Applicable only for Python language type.
booleanSpecifies whether the function/procedure is secure or not
booleanTrue if the UDF is a table function; false otherwise.
booleanSpecifies whether the UDF is temporary or not
object
integerThe maximum number of arguments
integerThe minimum number of arguments
stringRole that owns the function/procedure (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringThe type of role that owns the function/procedure (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
object
booleanTrue if the UDF is valid for clustering; false otherwise.
+
+
+ +## Methods +The following methods are available for this resource: -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlikeList UDFs
database_name, schema_name, nameWithArgs, endpointFetch a UDF
database_name, schema_name, endpointcreateMode, copyGrantsCreate a UDF
database_name, schema_name, nameWithArgs, endpointifExistsDelete a UDF
database_name, schema_name, nameWithArgs, targetDatabase, targetSchema, targetName, endpointifExistsRename a UDF
## Parameters -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringFunction's name with Args (example: foo(a number, b number))
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringDatabase of the target resource. Defaults to the source's database (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringName of the target resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
stringSchema of the target resource. Defaults to the source's schema (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$)
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -82,8 +401,8 @@ Creates, updates, deletes, gets or lists a user_defined_functions r values={[ { label: 'list_user_defined_functions', value: 'list_user_defined_functions' }, { label: 'fetch_user_defined_function', value: 'fetch_user_defined_function' } - ] -}> + ]} +> List UDFs @@ -91,11 +410,12 @@ List UDFs ```sql SELECT name, +database_name, +schema_name, arguments, body, comment, created_on, -database_name, is_aggregate, is_builtin, is_memoizable, @@ -108,12 +428,12 @@ min_num_arguments, owner, owner_role_type, return_type, -schema_name, valid_for_clustering FROM snowflake.user_defined_function.user_defined_functions -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -123,11 +443,12 @@ Fetch a UDF ```sql SELECT name, +database_name, +schema_name, arguments, body, comment, created_on, -database_name, is_aggregate, is_builtin, is_memoizable, @@ -140,33 +461,31 @@ min_num_arguments, owner, owner_role_type, return_type, -schema_name, valid_for_clustering FROM snowflake.user_defined_function.user_defined_functions -WHERE database_name = '{{ database_name }}' -AND nameWithArgs = '{{ nameWithArgs }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND nameWithArgs = '{{ nameWithArgs }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a UDF +## `INSERT` examples - + { label: 'create_user_defined_function', value: 'create_user_defined_function' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a UDF ```sql -/*+ create */ INSERT INTO snowflake.user_defined_function.user_defined_functions ( data__name, data__is_temporary, @@ -180,7 +499,9 @@ data__comment, data__body, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -195,40 +516,16 @@ SELECT '{{ body }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.user_defined_function.user_defined_functions ( -data__name, -data__arguments, -data__return_type, -data__language_config, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ arguments }}', -'{{ return_type }}', -'{{ language_config }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: user_defined_functions props: - name: database_name @@ -242,75 +539,105 @@ SELECT description: Required parameter for the user_defined_functions resource. - name: name value: string - description: >- - The name of the UDF (Required parameter for the user_defined_functions - resource.) + description: > + The name of the UDF + - name: is_temporary value: boolean - description: Specifies whether the UDF is temporary or not + description: > + Specifies whether the UDF is temporary or not + - name: is_aggregate value: boolean - description: >- - Specifies whether the UDF is an aggregate function. Applicable only for - Python language type + description: > + Specifies whether the UDF is an aggregate function. Applicable only for Python language type + - name: is_memoizable value: boolean - description: >- - Indicates whether the function is memoizable. Applicable only for Python - language type. + description: > + Indicates whether the function is memoizable. Applicable only for Python language type. + - name: is_secure value: boolean - description: Specifies whether the function/procedure is secure or not + description: > + Specifies whether the function/procedure is secure or not + - name: arguments - value: - - name: name - value: string - description: Argument name - - name: datatype - value: string - description: >- - Argument data type (valid values: 'ARRAY', 'BIGINT', 'BINARY', - 'BOOLEAN', 'BYTEINT', 'CHAR', 'CHARACTER', 'DATE', 'DATETIME', - 'DECIMAL', 'DOUBLE', 'DOUBLE PRECISION', 'FLOAT', 'FLOAT4', - 'FLOAT8', 'GEOGRAPHY', 'GEOMETRY', 'INT', 'INTEGER', 'NUMBER', - 'NUMERIC', 'OBJECT', 'REAL', 'STRING', 'SMALLINT', 'TEXT', 'TIME', - 'TIMESTAMP_LTZ', 'TIMESTAMP_NTZ', 'TIMESTAMP_TZ', 'TINYINT', - 'VARBINARY', 'VARCHAR', 'VARIANT', 'VECTOR') - - name: default_value - value: string - description: Default value of the argument - description: >- - List of arguments for the function/procedure (Required parameter for the - user_defined_functions resource.) + value: array + description: > + List of arguments for the function/procedure + - name: return_type - value: - type: string - description: Required parameter for the user_defined_functions resource. + value: object - name: language_config - value: - language: string - called_on_null_input: boolean - is_volatile: boolean - description: Required parameter for the user_defined_functions resource. + value: object - name: comment value: string - description: Specifies a comment for the function/procedure + description: > + Specifies a comment for the function/procedure + - name: body value: string - description: Function/procedure definition + description: > + Function/procedure definition + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a UDF ```sql -/*+ delete */ DELETE FROM snowflake.user_defined_function.user_defined_functions -WHERE database_name = '{{ database_name }}' -AND nameWithArgs = '{{ nameWithArgs }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND nameWithArgs = '{{ nameWithArgs }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Rename a UDF + +```sql +EXEC snowflake.user_defined_function.user_defined_functions.rename_user_defined_function +@database_name='{{ database_name }}' --required, +@schema_name='{{ schema_name }}' --required, +@nameWithArgs='{{ nameWithArgs }}' --required, +@targetDatabase='{{ targetDatabase }}' --required, +@targetSchema='{{ targetSchema }}' --required, +@targetName='{{ targetName }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/view/views/index.md b/docs/snowflake-docs/providers/snowflake/view/views/index.md index 1bc4045c8..d70e5002a 100644 --- a/docs/snowflake-docs/providers/snowflake/view/views/index.md +++ b/docs/snowflake-docs/providers/snowflake/view/views/index.md @@ -1,4 +1,4 @@ ---- +--- title: views hide_title: false hide_table_of_contents: false @@ -28,47 +28,289 @@ Creates, updates, deletes, gets or lists a views resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | Name of the view | -| | `array` | The columns of the view | -| | `string` | user comment associated to an object in the dictionary | -| | `string` | Date and time when the view was created. | -| | `string` | Database in which the view is stored | -| | `string` | Kind of the view, permanent (default) or temporary | -| | `string` | Role that owns the view | -| | `string` | The type of role that owns the view | -| | `string` | Query used to create the view | -| | `boolean` | Whether or not this view can refer to itself using recursive syntax withot requiring a CTE (common table expression) | -| | `string` | Schema in which the view is stored | -| | `boolean` | Whether or not this view is secure | -## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Fetch a view | -| | `SELECT` | | , , , , | List views | -| | `INSERT` | | , | Create a view | -| | `DELETE` | | | Delete a view | +The following fields are returned by `SELECT` queries: -
+ + +A Snowflake view -
-Optional Parameter Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the view
stringDatabase in which the view is stored
stringSchema in which the view is stored
arrayThe columns of the view
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the view was created.
stringKind of the view, permanent (default) or temporary
stringRole that owns the view
stringThe type of role that owns the view
stringQuery used to create the view
booleanWhether or not this view can refer to itself using recursive syntax withot requiring a CTE (common table expression)
booleanWhether or not this view is secure
+ + -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter to enable copy grants when creating the object. | `boolean` | `false` | -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Optionally includes dependency information of the view. | `boolean` | `-` | -| | Query parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. | `string` | `-` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | -| | Query parameter to limit the maximum number of rows returned by a command. | `integer` | `-` | -| | Query parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. | `string` | `-` | +A Snowflake view + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringName of the view
stringDatabase in which the view is stored
stringSchema in which the view is stored
arrayThe columns of the view
stringuser comment associated to an object in the dictionary
string (date-time)Date and time when the view was created.
stringKind of the view, permanent (default) or temporary
stringRole that owns the view
stringThe type of role that owns the view
stringQuery used to create the view
booleanWhether or not this view can refer to itself using recursive syntax withot requiring a CTE (common table expression)
booleanWhether or not this view is secure
+
+ + +## Methods -
+The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
database_name, schema_name, endpointlike, startsWith, showLimit, fromName, deepList views
database_name, schema_name, name, endpointFetch a view
database_name, schema_name, endpointcreateMode, copyGrantsCreate a view
database_name, schema_name, name, endpointifExistsDelete a view
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringIdentifier (i.e. name) for the database to which the resource belongs. You can use the `/api/v2/databases` GET request to get a list of available databases. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the `/api/v2/databases/{database}/schemas` GET request to get a list of available schemas for the specified database. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
booleanQuery parameter to enable copy grants when creating the object. (example: false, default: false)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanOptionally includes dependency information of the view.
stringQuery parameter to enable fetching rows only following the first row whose object name matches the specified string. Case-sensitive and does not have to be the full name. (example: from_test)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
integerQuery parameter to limit the maximum number of rows returned by a command. (example: 10, minimum: 1, maximum: 10000)
stringQuery parameter to filter the command output based on the string of characters that appear at the beginning of the object name. Uses case-sensitive pattern matching. (example: test)
## `SELECT` examples @@ -77,8 +319,8 @@ Creates, updates, deletes, gets or lists a views resource. values={[ { label: 'list_views', value: 'list_views' }, { label: 'fetch_view', value: 'fetch_view' } - ] -}> + ]} +> List views @@ -86,21 +328,26 @@ List views ```sql SELECT name, +database_name, +schema_name, columns, comment, created_on, -database_name, kind, owner, owner_role_type, query, recursive, -schema_name, secure FROM snowflake.view.views -WHERE database_name = '{{ database_name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}' +AND startsWith = '{{ startsWith }}' +AND showLimit = '{{ showLimit }}' +AND fromName = '{{ fromName }}' +AND deep = '{{ deep }}'; ``` @@ -110,42 +357,41 @@ Fetch a view ```sql SELECT name, +database_name, +schema_name, columns, comment, created_on, -database_name, kind, owner, owner_role_type, query, recursive, -schema_name, secure FROM snowflake.view.views -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' -- required +AND schema_name = '{{ schema_name }}' -- required +AND name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ```
-## `INSERT` example -Create a view +## `INSERT` examples - + { label: 'create_view', value: 'create_view' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a view ```sql -/*+ create */ INSERT INTO snowflake.view.views ( data__name, data__secure, @@ -156,7 +402,9 @@ data__comment, data__query, database_name, schema_name, -endpoint +endpoint, +createMode, +copyGrants ) SELECT '{{ name }}', @@ -168,38 +416,16 @@ SELECT '{{ query }}', '{{ database_name }}', '{{ schema_name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}', +'{{ copyGrants }}' ; ``` - - - -```sql -/*+ create */ -INSERT INTO snowflake.view.views ( -data__name, -data__columns, -data__query, -database_name, -schema_name, -endpoint -) -SELECT -'{{ name }}', -'{{ columns }}', -'{{ query }}', -'{{ database_name }}', -'{{ schema_name }}', -'{{ endpoint }}' -; -``` - - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: views props: - name: database_name @@ -213,50 +439,70 @@ SELECT description: Required parameter for the views resource. - name: name value: string - description: Name of the view (Required parameter for the views resource.) + description: > + Name of the view + - name: secure value: boolean - description: Whether or not this view is secure + description: > + Whether or not this view is secure + - name: kind value: string - description: >- - Kind of the view, permanent (default) or temporary (valid values: - 'PERMANENT', 'TEMPORARY') + description: > + Kind of the view, permanent (default) or temporary + + valid_values: ['PERMANENT', 'TEMPORARY'] - name: recursive value: boolean - description: >- - Whether or not this view can refer to itself using recursive syntax - withot requiring a CTE (common table expression) + description: > + Whether or not this view can refer to itself using recursive syntax withot requiring a CTE (common table expression) + - name: columns - value: - - name: name - value: string - description: Column name - - name: comment - value: string - description: Specifies a comment for the column - description: The columns of the view (Required parameter for the views resource.) + value: array + description: > + The columns of the view + - name: comment value: string - description: user comment associated to an object in the dictionary + description: > + user comment associated to an object in the dictionary + - name: query value: string - description: >- - Query used to create the view (Required parameter for the views - resource.) + description: > + Query used to create the view + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) + - name: copyGrants + value: boolean + description: Query parameter to enable copy grants when creating the object. (example: false, default: false) ``` -## `DELETE` example + +## `DELETE` examples + + + Delete a view ```sql -/*+ delete */ DELETE FROM snowflake.view.views -WHERE database_name = '{{ database_name }}' -AND name = '{{ name }}' -AND schema_name = '{{ schema_name }}' -AND endpoint = '{{ endpoint }}'; +WHERE database_name = '{{ database_name }}' --required +AND schema_name = '{{ schema_name }}' --required +AND name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; ``` + + diff --git a/docs/snowflake-docs/providers/snowflake/warehouse/warehouses/index.md b/docs/snowflake-docs/providers/snowflake/warehouse/warehouses/index.md index 5fcfe153d..0a686a667 100644 --- a/docs/snowflake-docs/providers/snowflake/warehouse/warehouses/index.md +++ b/docs/snowflake-docs/providers/snowflake/warehouse/warehouses/index.md @@ -1,4 +1,4 @@ ---- +--- title: warehouses hide_title: false hide_table_of_contents: false @@ -28,76 +28,570 @@ Creates, updates, deletes, gets or lists a warehouses resource. ## Fields -| Name | Datatype | Description | -|:-----|:---------|:------------| -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Specifies whether to automatically resume a warehouse when a SQL statement is submitted to it | -| | `integer` | time in seconds before auto suspend | -| | `string` | Percentage of the warehouse compute resources that are provisioned and available. | -| | `string` | Comment representing budget for warehouse. | -| | `string` | Specifies a comment for the warehouse | -| | `string` | Date and time when the warehouse was created. | -| | `string` | Specifies whether to enable the query acceleration service for queries that rely on this warehouse for compute resources | -| | `string` | Specifies whether the warehouse is created initially in the Suspended state | -| | `boolean` | Whether the warehouse is in use for the session. Only one warehouse can be in use at a time for a session. To specify or change the warehouse for a session, use the USE WAREHOUSE command. | -| | `boolean` | Whether the warehouse is the default for the current user. | -| | `string` | | -| | `integer` | Specifies the maximum number of clusters for a multi-cluster warehouse | -| | `integer` | Object parameter that specifies the concurrency level for SQL statements executed by a warehouse cluster | -| | `integer` | Specifies the minimum number of clusters for a multi-cluster warehouse | -| | `string` | Percentage of the warehouse compute resources that are in a state other than available, provisioning, or quiescing. | -| | `string` | Role that owns the warehouse. | -| | `string` | The type of role that owns the object. | -| | `string` | Percentage of the warehouse compute resources that are in the process of provisioning. | -| | `integer` | Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size | -| | `integer` | Number of SQL statements that are queued for the warehouse. | -| | `string` | Percentage of the warehouse compute resources that are executing SQL statements, but will be shut down once the queries complete. | -| | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. | -| | `string` | Date and time when the warehouse was last started or restarted. | -| | `integer` | Number of SQL statements that are being executed by the warehouse. | -| | `string` | Scaling policy of warehouse, possible scaling policies: STANDARD, ECONOMY | -| | `string` | [Deprecated] names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large | -| | `integer` | Number of clusters currently started. | -| | `string` | The state of warehouse, possible states: STARTED, STARTING, DYNAMIC, SUSPENDED, RESIZING, RESUMING, SUSPENDING | -| | `integer` | Object parameter that specifies the time, in seconds, a SQL statement can be queued on a warehouse before it is canceled by the system | -| | `integer` | Object parameter that specifies the time, in seconds, after which a running SQL statement is canceled by the system | -| | `string` | Names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large | -| | `string` | [Deprecated] Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED | -| | `string` | Date and time when the warehouse was last updated, which includes changing any of the properties of the warehouse or changing the state (STARTED, SUSPENDED, RESIZING) of the warehouse. | -| | `string` | When resizing a warehouse, you can use this parameter to block the return of the ALTER WAREHOUSE command until the resize has finished provisioning all its compute resources | -| | `integer` | Credit limit that are can be executed by the warehouse. | -| | `string` | Size of warehouse, possible sizes: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE | -| | `string` | Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED | + +The following fields are returned by `SELECT` queries: + + + + +A Snowflake virtual warehouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSpecifies whether to automatically resume a warehouse when a SQL statement is submitted to it
integer (int32)time in seconds before auto suspend
string (Percentage)Percentage of the warehouse compute resources that are provisioned and available.
stringComment representing budget for warehouse.
string (comment)Specifies a comment for the warehouse
string (date-time)Date and time when the warehouse was created.
stringSpecifies whether to enable the query acceleration service for queries that rely on this warehouse for compute resources
stringSpecifies whether the warehouse is created initially in the Suspended state
booleanWhether the warehouse is in use for the session. Only one warehouse can be in use at a time for a session. To specify or change the warehouse for a session, use the USE WAREHOUSE command.
booleanWhether the warehouse is the default for the current user.
string (warehouse)
integer (int32)Specifies the maximum number of clusters for a multi-cluster warehouse
integer (int32)Object parameter that specifies the concurrency level for SQL statements executed by a warehouse cluster
integer (int32)Specifies the minimum number of clusters for a multi-cluster warehouse
string (Percentage)Percentage of the warehouse compute resources that are in a state other than available, provisioning, or quiescing.
string (role name)Role that owns the warehouse.
stringThe type of role that owns the object.
string (Percentage)Percentage of the warehouse compute resources that are in the process of provisioning.
integer (int32)Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size
integer (int32)Number of SQL statements that are queued for the warehouse.
string (Percentage)Percentage of the warehouse compute resources that are executing SQL statements, but will be shut down once the queries complete.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
string (date-time)Date and time when the warehouse was last started or restarted.
integer (int32)Number of SQL statements that are being executed by the warehouse.
stringScaling policy of warehouse, possible scaling policies: STANDARD, ECONOMY
string[Deprecated] names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large
integer (int32)Number of clusters currently started.
stringThe state of warehouse, possible states: STARTED, STARTING, DYNAMIC, SUSPENDED, RESIZING, RESUMING, SUSPENDING
integer (int32)Object parameter that specifies the time, in seconds, a SQL statement can be queued on a warehouse before it is canceled by the system
integer (int32)Object parameter that specifies the time, in seconds, after which a running SQL statement is canceled by the system
stringNames of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large
string[Deprecated] Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED
string (date-time)Date and time when the warehouse was last updated, which includes changing any of the properties of the warehouse or changing the state (STARTED, SUSPENDED, RESIZING) of the warehouse.
stringWhen resizing a warehouse, you can use this parameter to block the return of the ALTER WAREHOUSE command until the resize has finished provisioning all its compute resources
integer (int64)Credit limit that are can be executed by the warehouse.
stringSize of warehouse, possible sizes: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE
stringType of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED
+
+ + +A Snowflake virtual warehouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringSpecifies whether to automatically resume a warehouse when a SQL statement is submitted to it
integer (int32)time in seconds before auto suspend
string (Percentage)Percentage of the warehouse compute resources that are provisioned and available.
stringComment representing budget for warehouse.
string (comment)Specifies a comment for the warehouse
string (date-time)Date and time when the warehouse was created.
stringSpecifies whether to enable the query acceleration service for queries that rely on this warehouse for compute resources
stringSpecifies whether the warehouse is created initially in the Suspended state
booleanWhether the warehouse is in use for the session. Only one warehouse can be in use at a time for a session. To specify or change the warehouse for a session, use the USE WAREHOUSE command.
booleanWhether the warehouse is the default for the current user.
string (warehouse)
integer (int32)Specifies the maximum number of clusters for a multi-cluster warehouse
integer (int32)Object parameter that specifies the concurrency level for SQL statements executed by a warehouse cluster
integer (int32)Specifies the minimum number of clusters for a multi-cluster warehouse
string (Percentage)Percentage of the warehouse compute resources that are in a state other than available, provisioning, or quiescing.
string (role name)Role that owns the warehouse.
stringThe type of role that owns the object.
string (Percentage)Percentage of the warehouse compute resources that are in the process of provisioning.
integer (int32)Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size
integer (int32)Number of SQL statements that are queued for the warehouse.
string (Percentage)Percentage of the warehouse compute resources that are executing SQL statements, but will be shut down once the queries complete.
stringA Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
string (date-time)Date and time when the warehouse was last started or restarted.
integer (int32)Number of SQL statements that are being executed by the warehouse.
stringScaling policy of warehouse, possible scaling policies: STANDARD, ECONOMY
string[Deprecated] names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large
integer (int32)Number of clusters currently started.
stringThe state of warehouse, possible states: STARTED, STARTING, DYNAMIC, SUSPENDED, RESIZING, RESUMING, SUSPENDING
integer (int32)Object parameter that specifies the time, in seconds, a SQL statement can be queued on a warehouse before it is canceled by the system
integer (int32)Object parameter that specifies the time, in seconds, after which a running SQL statement is canceled by the system
stringNames of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large
string[Deprecated] Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED
string (date-time)Date and time when the warehouse was last updated, which includes changing any of the properties of the warehouse or changing the state (STARTED, SUSPENDED, RESIZING) of the warehouse.
stringWhen resizing a warehouse, you can use this parameter to block the return of the ALTER WAREHOUSE command until the resize has finished provisioning all its compute resources
integer (int64)Credit limit that are can be executed by the warehouse.
stringSize of warehouse, possible sizes: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE
stringType of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED
+
+
## Methods -| Name | Accessible by | Required Params | Optional Params | Description | -|:-----|:--------------|:----------------|:----------------|:------------| -| | `SELECT` | | - | Describes the warehouse, show information of the chosen warehouse. Equivalent to DESCRIBE WAREHOUSE in SQL. | -| | `SELECT` | | | Show a list of warehouse filtered by pattern. Equivalent to SHOW WAREHOUSE in SQL. | -| | `INSERT` | | | Create a virtual warehouse. Equivalent to CREATE WAREHOUSE in SQL. | -| | `DELETE` | | | Removes the specified virtual warehouse from the system. Equivalent to DROP WAREHOUSE in SQL. | -| | `REPLACE` | | - | Create a (or alter an existing) warehouse. Even if the operation is just an alter, the full property set must be provided. | -| | `EXEC` | | | Aborts all the queries currently running or queued on the warehouse. | -| | `EXEC` | | | Disable an adaptive warehouse and put the warehouse into a ‘disabled’ state, if the warehouse is not disabled. | -| | `EXEC` | | | Enable an adaptive warehouse and put the warehouse into a ‘enabled’ state, if the warehouse is not enabled. | -| | `EXEC` | | | Specifies a new identifier for the warehouse; must be unique for current account. | -| | `EXEC` | | | Bring current warehouse to a usable ‘Running’ state by provisioning compute resources if current warehouse is suspended. | -| | `EXEC` | | | Remove all compute nodes from a warehouse and put the warehouse into a ‘Suspended’ state if current warehouse is not suspended. | -| | `EXEC` | | - | [Deprecated] Specifies the active/current warehouse for the session. | - -
- - -
-Optional Parameter Details - -| Name | Description | Type | Default | -|------|-------------|------|---------| -| | Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. | `string` | `errorIfExists` | -| | Query parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. | `boolean` | `false` | -| | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | `string` | `-` | - -
+ +The following methods are available for this resource: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameAccessible byRequired ParamsOptional ParamsDescription
endpointlikeShow a list of warehouse filtered by pattern. Equivalent to SHOW WAREHOUSE in SQL.
name, endpointDescribes the warehouse, show information of the chosen warehouse. Equivalent to DESCRIBE WAREHOUSE in SQL.
endpointcreateModeCreate a virtual warehouse. Equivalent to CREATE WAREHOUSE in SQL.
name, endpointCreate a (or alter an existing) warehouse. Even if the operation is just an alter, the full property set must be provided.
name, endpointifExistsRemoves the specified virtual warehouse from the system. Equivalent to DROP WAREHOUSE in SQL.
name, endpointifExistsBring current warehouse to a usable ‘Running’ state by provisioning compute resources if current warehouse is suspended.
name, endpointifExistsRemove all compute nodes from a warehouse and put the warehouse into a ‘Suspended’ state if current warehouse is not suspended.
name, endpointifExistsSpecifies a new identifier for the warehouse; must be unique for current account.
name, endpointifExistsAborts all the queries currently running or queued on the warehouse.
name, endpoint[Deprecated] Specifies the active/current warehouse for the session.
name, endpointifExistsEnable an adaptive warehouse and put the warehouse into a ‘enabled’ state, if the warehouse is not enabled.
name, endpointifExistsDisable an adaptive warehouse and put the warehouse into a ‘disabled’ state, if the warehouse is not disabled.
## Parameters + +Parameters can be passed in the `WHERE` clause of a query. Check the [Methods](#methods) section to see which parameters are required or optional for each operation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatatypeDescription
stringOrganization and Account Name (default: orgid-acctid)
stringIdentifier (i.e. name) for the resource. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME)
stringQuery parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists)
booleanQuery parameter that specifies how to handle the request for a resource that does not exist: - `true`: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - `false`: The endpoint throws an error if the resource doesn't exist. (example: true, default: false)
stringQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. (example: test_%)
## `SELECT` examples @@ -106,8 +600,8 @@ Creates, updates, deletes, gets or lists a warehouses resource. values={[ { label: 'list_warehouses', value: 'list_warehouses' }, { label: 'fetch_warehouse', value: 'fetch_warehouse' } - ] -}> + ]} +> Show a list of warehouse filtered by pattern. Equivalent to SHOW WAREHOUSE in SQL. @@ -153,7 +647,8 @@ warehouse_credit_limit, warehouse_size, warehouse_type FROM snowflake.warehouse.warehouses -WHERE endpoint = '{{ endpoint }}'; +WHERE endpoint = '{{ endpoint }}' -- required +AND like = '{{ like }}'; ``` @@ -201,28 +696,27 @@ warehouse_credit_limit, warehouse_size, warehouse_type FROM snowflake.warehouse.warehouses -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' -- required +AND endpoint = '{{ endpoint }}' -- required; ``` -## `INSERT` example -Create a virtual warehouse. Equivalent to CREATE WAREHOUSE in SQL. +## `INSERT` examples - + { label: 'create_warehouse', value: 'create_warehouse' }, + { label: 'Manifest', value: 'manifest' } + ]} +> + + +Create a virtual warehouse. Equivalent to CREATE WAREHOUSE in SQL. ```sql -/*+ create */ INSERT INTO snowflake.warehouse.warehouses ( data__name, data__warehouse_type, @@ -245,7 +739,8 @@ data__type, data__size, data__warehouse_credit_limit, data__target_statement_size, -endpoint +endpoint, +createMode ) SELECT '{{ name }}', @@ -269,30 +764,15 @@ SELECT '{{ size }}', {{ warehouse_credit_limit }}, '{{ target_statement_size }}', -'{{ endpoint }}' -; -``` - - - - -```sql -/*+ create */ -INSERT INTO snowflake.warehouse.warehouses ( -data__name, -endpoint -) -SELECT -'{{ name }}', -'{{ endpoint }}' +'{{ endpoint }}', +'{{ createMode }}' ; ``` - ```yaml -# Description fields below are for documentation purposes only and are not required in the manifest +# Description fields are for documentation purposes - name: warehouses props: - name: endpoint @@ -300,149 +780,300 @@ SELECT description: Required parameter for the warehouses resource. - name: name value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. (Required - parameter for the warehouses resource.) + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: warehouse_type value: string - description: 'Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED' + description: > + Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED + - name: warehouse_size value: string - description: >- - Size of warehouse, possible sizes: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, - XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE + description: > + Size of warehouse, possible sizes: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE + - name: wait_for_completion value: string - description: >- - When resizing a warehouse, you can use this parameter to block the - return of the ALTER WAREHOUSE command until the resize has finished - provisioning all its compute resources (valid values: 'true', 'false') + description: > + When resizing a warehouse, you can use this parameter to block the return of the ALTER WAREHOUSE command until the resize has finished provisioning all its compute resources + + valid_values: ['true', 'false'] - name: max_cluster_count value: integer - description: Specifies the maximum number of clusters for a multi-cluster warehouse + description: > + Specifies the maximum number of clusters for a multi-cluster warehouse + - name: min_cluster_count value: integer - description: Specifies the minimum number of clusters for a multi-cluster warehouse + description: > + Specifies the minimum number of clusters for a multi-cluster warehouse + - name: scaling_policy value: string - description: >- - Scaling policy of warehouse, possible scaling policies: STANDARD, - ECONOMY + description: > + Scaling policy of warehouse, possible scaling policies: STANDARD, ECONOMY + - name: auto_suspend value: integer - description: time in seconds before auto suspend + description: > + time in seconds before auto suspend + - name: auto_resume value: string - description: >- - Specifies whether to automatically resume a warehouse when a SQL - statement is submitted to it (valid values: 'true', 'false') + description: > + Specifies whether to automatically resume a warehouse when a SQL statement is submitted to it + + valid_values: ['true', 'false'] - name: initially_suspended value: string - description: >- - Specifies whether the warehouse is created initially in the Suspended - state (valid values: 'true', 'false') + description: > + Specifies whether the warehouse is created initially in the Suspended state + + valid_values: ['true', 'false'] - name: resource_monitor value: string - description: >- - A Snowflake object identifier. If the identifier contains spaces or - special characters, the entire string must be enclosed in double quotes. - Identifiers enclosed in double quotes are also case-sensitive. + description: > + A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. + - name: comment value: string - description: Specifies a comment for the warehouse + description: > + Specifies a comment for the warehouse + - name: enable_query_acceleration value: string - description: >- - Specifies whether to enable the query acceleration service for queries - that rely on this warehouse for compute resources (valid values: 'true', - 'false') + description: > + Specifies whether to enable the query acceleration service for queries that rely on this warehouse for compute resources + + valid_values: ['true', 'false'] - name: query_acceleration_max_scale_factor value: integer - description: >- - Specifies the maximum scale factor for leasing compute resources for - query acceleration. The scale factor is used as a multiplier based on - warehouse size + description: > + Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size + - name: max_concurrency_level value: integer - description: >- - Object parameter that specifies the concurrency level for SQL statements - executed by a warehouse cluster + description: > + Object parameter that specifies the concurrency level for SQL statements executed by a warehouse cluster + - name: statement_queued_timeout_in_seconds value: integer - description: >- - Object parameter that specifies the time, in seconds, a SQL statement - can be queued on a warehouse before it is canceled by the system + description: > + Object parameter that specifies the time, in seconds, a SQL statement can be queued on a warehouse before it is canceled by the system + - name: statement_timeout_in_seconds value: integer - description: >- - Object parameter that specifies the time, in seconds, after which a - running SQL statement is canceled by the system + description: > + Object parameter that specifies the time, in seconds, after which a running SQL statement is canceled by the system + - name: type value: string - description: >- - [Deprecated] Type of warehouse, possible types: STANDARD, - SNOWPARK-OPTIMIZED + description: > + [Deprecated] Type of warehouse, possible types: STANDARD, SNOWPARK-OPTIMIZED + - name: size value: string - description: >- - [Deprecated] names of size: X-Small, Small, Medium, Large, X-Large, - 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large + description: > + [Deprecated] names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large + - name: warehouse_credit_limit value: integer - description: Credit limit that are can be executed by the warehouse. + description: > + Credit limit that are can be executed by the warehouse. + - name: target_statement_size value: string - description: >- - Names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, - 3X-Large, 4X-Large, 5X-Large, 6X-Large + description: > + Names of size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large, 6X-Large + + - name: createMode + value: string + description: Query parameter allowing support for different modes of resource creation. Possible values include: - `errorIfExists`: Throws an error if you try to create a resource that already exists. - `orReplace`: Automatically replaces the existing resource with the current one. - `ifNotExists`: Creates a new resource when an alter is requested for a non-existent resource. (enum: [errorIfExists, orReplace, ifNotExists], example: ifNotExists, default: errorIfExists) ``` -## `REPLACE` example + +## `REPLACE` examples + + + Create a (or alter an existing) warehouse. Even if the operation is just an alter, the full property set must be provided. ```sql -/*+ update */ REPLACE snowflake.warehouse.warehouses SET -name = '{{ name }}', -warehouse_type = '{{ warehouse_type }}', -warehouse_size = '{{ warehouse_size }}', -wait_for_completion = '{{ wait_for_completion }}', -max_cluster_count = {{ max_cluster_count }}, -min_cluster_count = {{ min_cluster_count }}, -scaling_policy = '{{ scaling_policy }}', -auto_suspend = {{ auto_suspend }}, -auto_resume = '{{ auto_resume }}', -initially_suspended = '{{ initially_suspended }}', -resource_monitor = '{{ resource_monitor }}', -comment = '{{ comment }}', -enable_query_acceleration = '{{ enable_query_acceleration }}', -query_acceleration_max_scale_factor = {{ query_acceleration_max_scale_factor }}, -max_concurrency_level = {{ max_concurrency_level }}, -statement_queued_timeout_in_seconds = {{ statement_queued_timeout_in_seconds }}, -statement_timeout_in_seconds = {{ statement_timeout_in_seconds }}, -type = '{{ type }}', -size = '{{ size }}', -warehouse_credit_limit = {{ warehouse_credit_limit }}, -target_statement_size = '{{ target_statement_size }}' +data__name = '{{ name }}', +data__warehouse_type = '{{ warehouse_type }}', +data__warehouse_size = '{{ warehouse_size }}', +data__wait_for_completion = '{{ wait_for_completion }}', +data__max_cluster_count = {{ max_cluster_count }}, +data__min_cluster_count = {{ min_cluster_count }}, +data__scaling_policy = '{{ scaling_policy }}', +data__auto_suspend = {{ auto_suspend }}, +data__auto_resume = '{{ auto_resume }}', +data__initially_suspended = '{{ initially_suspended }}', +data__resource_monitor = '{{ resource_monitor }}', +data__comment = '{{ comment }}', +data__enable_query_acceleration = '{{ enable_query_acceleration }}', +data__query_acceleration_max_scale_factor = {{ query_acceleration_max_scale_factor }}, +data__max_concurrency_level = {{ max_concurrency_level }}, +data__statement_queued_timeout_in_seconds = {{ statement_queued_timeout_in_seconds }}, +data__statement_timeout_in_seconds = {{ statement_timeout_in_seconds }}, +data__type = '{{ type }}', +data__size = '{{ size }}', +data__warehouse_credit_limit = {{ warehouse_credit_limit }}, +data__target_statement_size = '{{ target_statement_size }}' WHERE -name = '{{ name }}' -AND data__name = '{{ data__name }}' -AND endpoint = '{{ endpoint }}'; +name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND data__name = '{{ name }}' --required; ``` + + + -## `DELETE` example +## `DELETE` examples + + + Removes the specified virtual warehouse from the system. Equivalent to DROP WAREHOUSE in SQL. ```sql -/*+ delete */ DELETE FROM snowflake.warehouse.warehouses -WHERE name = '{{ name }}' -AND endpoint = '{{ endpoint }}'; +WHERE name = '{{ name }}' --required +AND endpoint = '{{ endpoint }}' --required +AND ifExists = '{{ ifExists }}'; +``` + + + + +## Lifecycle Methods + + + + +Bring current warehouse to a usable ‘Running’ state by provisioning compute resources if current warehouse is suspended. + +```sql +EXEC snowflake.warehouse.warehouses.resume_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Remove all compute nodes from a warehouse and put the warehouse into a ‘Suspended’ state if current warehouse is not suspended. + +```sql +EXEC snowflake.warehouse.warehouses.suspend_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Specifies a new identifier for the warehouse; must be unique for current account. + +```sql +EXEC snowflake.warehouse.warehouses.rename_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }} +@@json= +'{ +"name": "{{ name }}", +"warehouse_type": "{{ warehouse_type }}", +"warehouse_size": "{{ warehouse_size }}", +"wait_for_completion": "{{ wait_for_completion }}", +"max_cluster_count": {{ max_cluster_count }}, +"min_cluster_count": {{ min_cluster_count }}, +"scaling_policy": "{{ scaling_policy }}", +"auto_suspend": {{ auto_suspend }}, +"auto_resume": "{{ auto_resume }}", +"initially_suspended": "{{ initially_suspended }}", +"resource_monitor": "{{ resource_monitor }}", +"comment": "{{ comment }}", +"enable_query_acceleration": "{{ enable_query_acceleration }}", +"query_acceleration_max_scale_factor": {{ query_acceleration_max_scale_factor }}, +"max_concurrency_level": {{ max_concurrency_level }}, +"statement_queued_timeout_in_seconds": {{ statement_queued_timeout_in_seconds }}, +"statement_timeout_in_seconds": {{ statement_timeout_in_seconds }}, +"type": "{{ type }}", +"size": "{{ size }}", +"warehouse_credit_limit": {{ warehouse_credit_limit }}, +"target_statement_size": "{{ target_statement_size }}" +}'; +``` + + + +Aborts all the queries currently running or queued on the warehouse. + +```sql +EXEC snowflake.warehouse.warehouses.abort_all_queries_on_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; ``` + + + +[Deprecated] Specifies the active/current warehouse for the session. + +```sql +EXEC snowflake.warehouse.warehouses.use_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required; +``` + + + +Enable an adaptive warehouse and put the warehouse into a ‘enabled’ state, if the warehouse is not enabled. + +```sql +EXEC snowflake.warehouse.warehouses.enable_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + + + +Disable an adaptive warehouse and put the warehouse into a ‘disabled’ state, if the warehouse is not disabled. + +```sql +EXEC snowflake.warehouse.warehouses.disable_warehouse +@name='{{ name }}' --required, +@endpoint='{{ endpoint }}' --required, +@ifExists={{ ifExists }}; +``` + +