Schema
List schemas¶
GET/api/v2/databases/{database}/schemas
Lists the accessible schemas.
Path Parameters¶
| Parameter | Description |
|---|---|
| database | Identifier (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. |
Query Parameters¶
| Parameter | Description |
|---|---|
| like string | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. |
| startsWith string | 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. |
| showLimit integer | Query parameter to limit the maximum number of rows returned by a command. |
| fromName string | 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. |
| history boolean | Whether to include dropped schemas that have not yet been purged. Default: `false`. |
Response¶
| Code | Description |
|---|---|
| 200 | Successful request. |
| 202 | Successfully accepted the request, but it is not completed yet. |
Create a schema¶
POST/api/v2/databases/{database}/schemas
Creates a schema, with modifiers as query parameters. You must provide the full schema definition when creating a schema.
Query Parameters¶
| Parameter | Description |
|---|---|
| createMode string | Query parameter allowing support for different modes of resource creation. Possible values include:
|
| kind string | Type of schema to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). |
Response¶
| Code | Description |
|---|---|
| 200 | Successful request. |
| 202 |
Clone a schema¶
POST/api/v2/databases/{database}/schemas/{name}:clone
Clones an existing schema, with modifiers as query parameters. You must provide the full schema definition when cloning an existing schema.
Query Parameters¶
| Parameter | Description |
|---|---|
| kind string | Type of schema to clone. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). |
| targetDatabase string | Database of the newly created schema. Defaults to the source schema's database. |
Response¶
| Code | Description |
|---|---|
| 200 | |
| 202 |
Undrop a schema¶
POST/api/v2/databases/{database}/schemas/{name}:undrop
Undrops schema.
Response¶
| Code | Description |
|---|---|
| 200 | |
| 202 |
Fetches a schema¶
Create a new, or alters an existing, schema¶
PUT/api/v2/databases/{database}/schemas/{name}
Creates a new, or alters an existing, schema. You must provide the full schema definition even when altering an existing schema.
Query Parameters¶
| Parameter | Description |
|---|---|
| kind string | Type of schema to create. Currently, Snowflake supports only `transient` and `permanent` (also represented by the empty string). |
Response¶
| Code | Description |
|---|---|
| 200 | |
| 202 |
Delete a schema¶
DELETE/api/v2/databases/{database}/schemas/{name}
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.
Query Parameters¶
| Parameter | Description |
|---|---|
| ifExists boolean | Query parameter that specifies how to handle the request for a resource that does not exist:
|
| restrict boolean | Whether to drop the schema if foreign keys exist that reference any tables in the schema.
|
Response¶
| Code | Description |
|---|---|
| 200 | |
| 202 |