Database Destinations
A Database Destination is a named connection from Files.com to one existing table in Snowflake, BigQuery, Supabase, PostgreSQL, or MySQL. Use it with the Import into Database action in Automations v2 to append rows from a CSV file or structured data. This fits a workflow where Files.com starts the load, such as when a supplier uploads an order file that your reporting database needs. Use a separate load process if you need to update existing records or replace the table.
Destination and Credential
A Site Administrator can register destinations across Workspaces. A Workspace Administrator registers destinations in their own Workspace. The Automation, destination, and Secret must belong to the same Workspace, including when the Automation runs in the Default Workspace.
Have the database owner create the table and grant the connection identity permission to write to it. Register a destination by name, using the exact table name and the provider details below, then select the saved Secret for that connection. You can rename a destination or replace its Secret. To change the provider, connection address, or target table, register a new destination and update the Automations that should use it.
| Provider | Table and Connection Details | Secret | Provider Permissions |
|---|---|---|---|
| Snowflake | Account identifier in organization-account format, database, schema, and table. Specify a warehouse and role if the user's defaults are unsuitable. | Token Secret with a programmatic access token. | The role used by the connection needs USAGE on the warehouse, database, and schema and INSERT on the table. The account's network policy must allow the connection. |
| BigQuery | Google Cloud project ID, dataset, table, and the dataset's location, such as US or europe-west1. The table's project also runs the load job. | Key/Value Secret with the named values from a Google Cloud JSON service account key. | The service account needs permission to run load jobs in the project and append to the target table. |
| Supabase | Project's direct database or session pooler hostname, port, database, schema, table, and the project's CA certificate from Database Settings. | Basic Secret with the username and password for the chosen PostgreSQL connection. For the session pooler, use the username shown in its connection details. | The database role needs permission to connect, use the schema, and insert into the table. Any row-level policies on the table must allow the inserts. |
| PostgreSQL | Host, port, database, schema, and table. | Basic Secret with the database username and password. | The database role needs permission to connect, use the schema, and insert into the table. Any row-level policies on the table must allow the inserts. |
| MySQL | Hostname, port, database, and an InnoDB table. InnoDB lets Files.com commit the batch as one transaction. | Basic Secret with the database username and password. | The database account needs permission to connect and insert into the table. |
For Supabase, PostgreSQL, and MySQL, use a publicly reachable database endpoint and allow the connection through any database network restrictions. Files.com connects over TLS and verifies the server certificate against the configured address. PostgreSQL and MySQL use system-trusted certificate authorities by default. Supply the CA certificate or bundle if the database uses a different issuing authority. The default port is 5432 for Supabase and PostgreSQL and 3306 for MySQL.
Appending Rows From an Automation
In Automations v2, give Import into Database a CSV file or a data item and select the Database Destination. Each item supplies one batch. For a CSV, Files.com uses the first row as column names and reads the following rows as data. If the names and values already match the table, leave the Rows expression at its default, payload.
Use a TransformScript expression in Rows to rename columns, choose which values to send, or convert them to the types the table expects. For structured data, use payload for an item that is itself a row, or an expression such as payload.rows if the rows are nested. The expression must return one row object or an array of row objects. Each row in a batch must supply the same set of exact column names. Values can be strings, numbers, booleans, or null. An empty array inserts zero rows.
For example, a supplier's order CSV might look like this:
OrderID,Quantity
00124,3
00125,7
Use a File Action trigger in file mode to start when a new CSV arrives in the supplier's intake folder. Connect Import into Database to the trigger. If the table has a text column named order_id and a numeric column named quantity, set Rows to:
payload map (row) -> { order_id: row.OrderID, quantity: row.Quantity as Number }
The expression preserves the leading zeros in the order IDs and converts the quantities from CSV text to numbers. To verify the workflow, send the sample to a test table with the same columns and check that the import confirms two rows and that both IDs and quantities appear as expected.
Batch Limits and Write Confirmation
Each input item can produce up to 1,000 rows and 10,000 cells, including cells with null values. Keep the input and the mapped batch each within 1 MB. Snowflake also limits the encoded write request to 1 MB, so a batch near the size limit may need to be smaller. Split oversized inputs into separate items before the import. Each batch is written as a unit. If a run processes several inputs, earlier batches can succeed even if a later one fails.
Once the database confirms a write, the action passes the original file or data item to the next node with the confirmed number of rows inserted in the item's outcome. Use Run Detail to distinguish completed items from errors. A retry of the original run reuses confirmed results.
If a database write is unconfirmed, check the destination before starting a fresh run. Look for that batch's rows or check the provider's job or statement history when the error supplies a reference. The database may have committed the batch even if Files.com did not receive confirmation. Starting a fresh run with the same input can append the same rows again.