How do I set up a writeback from Foundry to a JDBC source?

Viewed 105

In the documentation, I can find a wealth of information on setting up a sync from a JDBC source to Foundry but I struggle to find guidance on setting this up bidirectionally. Would I use Tasks for this?

Specifically, how do I overwrite tables or rows in the connected database with Foundry data (as opposed to creating new tables or appending rows in the database)?

1 Answers

Export tasks would be the solution here. You can overwrite the tables by setting writeMode: Overwrite.

An example configuration will be:

type: export-jdbc-task
exporterType: parquet
datasets:
  - datasetRid: ri.foundry.main.dataset.{RID}  # legacy option for versions < 3.10 & < 4.4
    inputAlias: myInput  # only required if you have more than 1 input
    writeDirectly: true
    writeMode: Overwrite
    table:
      database: mydb  # Optional
      schema: public  # Optional
      table: mytable

I'd also recommend to check out the JDBC part of Export Tasks documentation to confirm the default behaviour corresponds to your expectations. There are multiple parameters you can configure, like incremental exports, copy mode, parallelism, SQL statements to execute before and after export.

Related