Database Destinations
A Database Destination lets an Automation append rows to an existing table. Each destination references a credential in the Secret Store.
List Database Destinations
SDK Method
database_destination.List()
Return Values
Returns a *database_destination.Iter and an error. Range over All() to receive files_sdk.DatabaseDestination values and errors.
Check each loop error before using its resource. Next() and Err() remain supported.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Additional Arguments
Show Database Destination
SDK Method
database_destination.Find()
Return Values
Returns a files_sdk.DatabaseDestination value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
DatabaseDestinationFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Database Destination ID. |
Create Database Destination
SDK Method
database_destination.Create()
Return Values
Returns a files_sdk.DatabaseDestination value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
DatabaseDestinationCreateParams Fields
| Field | Default | Description |
|---|---|---|
| Name string Required | Name of the destination. | |
| Provider string Required | Database provider. Possible values: snowflake, bigquery, supabase, postgresql, mysql | |
| Config object Required | Provider settings for the destination. Use the schema matching provider. The connection address and table are fixed after creation. | |
| SecretId int64 Required | ID of a Secret in the same Workspace. Use a Token Secret for Snowflake, a service account Key/Value Secret for BigQuery, or a Username/Password Secret for a database login. | |
| WorkspaceId int64 | 0 | Workspace ID. 0 means the default workspace. |
Update Database Destination
SDK Method
database_destination.Update()
Return Values
Returns a files_sdk.DatabaseDestination value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
DatabaseDestinationUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Database Destination ID. |
| Name string | Name of the destination. |
| SecretId int64 | ID of a Secret in the same Workspace. Use a Token Secret for Snowflake, a service account Key/Value Secret for BigQuery, or a Username/Password Secret for a database login. |
| Config object | Provider settings for the destination. Use the schema matching provider. The connection address and table are fixed after creation. |
Delete Database Destination
SDK Method
database_destination.Delete()
Return Values
Returns an error, or nil on success.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
DatabaseDestinationDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Database Destination ID. |
The DatabaseDestination Object
Some of the methods above return a DatabaseDestination object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | Database Destination ID. |
| WorkspaceId int64 | Workspace ID. 0 means the default workspace. |
| Name string | Name of the destination. |
| Provider string | Database provider. Possible values: snowflake, bigquery, supabase, postgresql, mysql |
| Config object | Provider settings for the destination. Use the schema matching provider. The connection address and table are fixed after creation. |
| SecretId int64 | ID of a Secret in the same Workspace. Use a Token Secret for Snowflake, a service account Key/Value Secret for BigQuery, or a Username/Password Secret for a database login. |
| CreatedAt date-time | When the destination was created. |
| UpdatedAt date-time | When the destination was last updated. |
config
| Value type | Description |
|---|---|
| object |