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

DatabaseDestination.List();

Return Object

FilesList<DatabaseDestination>

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

Example Request

using FilesCom.Models;

try
{
    var databaseDestinationIterator = DatabaseDestination.List();
    await foreach (DatabaseDestination databaseDestination in databaseDestinationIterator.ListAutoPagingAsync()) {
        // Operate on databaseDestination
    }
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Show Database Destination

SDK Method

DatabaseDestination.Find();

Return Object

DatabaseDestination

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.

Method Arguments

ArgumentDescription
id
int64
Required
Database Destination ID.

Example Request

using FilesCom.Models;

try
{
    var databaseDestination = await DatabaseDestination.Find(1L);
    // Operate on databaseDestination
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Create Database Destination

SDK Method

DatabaseDestination.Create();

Return Object

DatabaseDestination

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.

Method Arguments

ArgumentDefaultDescription
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.
secret_id
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.
workspace_id
int64
0Workspace ID. 0 means the default workspace.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("name", "Orders");
parameters.Add("provider", "snowflake");
parameters.Add("config", new Dictionary<string, object> { { "account_identifier", "value" }, { "database_name", "value" }, { "schema_name", "value" }, { "table_name", "value" } });
parameters.Add("secret_id", 1L);

try
{
    var databaseDestination = await DatabaseDestination.Create(parameters);
    // Operate on databaseDestination
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Update Database Destination

SDK Method

databaseDestination.Update();

Return Object

DatabaseDestination

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.

Method Arguments

ArgumentDescription
name
string
Name of the destination.
secret_id
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.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("name", "Orders");

try
{
    // Find the databaseDestination object by its id.
    var databaseDestination = await DatabaseDestination.Find(1L);
    await databaseDestination.Update(parameters);
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Delete Database Destination

SDK Method

databaseDestination.Delete();

Return Object

No return value.

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.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();

try
{
    // Find the databaseDestination object by its id.
    var databaseDestination = await DatabaseDestination.Find(1L);
    await databaseDestination.Delete(parameters);
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

The DatabaseDestination Object

Some of the methods above return a DatabaseDestination object. The attributes of this object are listed below.

AttributeDescription
id
int64
Database Destination ID.
workspace_id
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.
secret_id
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.
created_at
date-time
When the destination was created.
updated_at
date-time
When the destination was last updated.

config

Value typeDescription
object