Does the DB Writer node overwrite the data in the database where it is being saved when the original data is no longer there?
Example: I connect a Postgresql database and read the data using DB Reader, then I write that data to an SQLite database using DB Writer. If on April 20th I have 5 rows in the Postgresql database and save them in the SQLite database, but the next day I delete one row in the Postgresql database and now I only have 4 rows, will that row also be automatically deleted from SQLite when using the DB Writer node again?
If the rows are deleted, how can I save the new data in SQLite without deleting the previously saved data?
What I want to archive is only to save incremental data. Example:
Day 1: Postgresql with 10 rows => saved to Sqlite database.
Day 2: 2 rows deleted from Postgresql database and 3 rows added => save only 3 additional rows to Sqlite and kept previously saved rows.
Hello @Marthael ,
the DB Writer node has no idea about the state of your source database. It only sees the data on its input port. So if the input table contains three rows these three rows will be appended to an existing table or written to a new table if it doesn’t exist already.
Tip: If you know that the target table exists in the database use the DB Inserter node instead of the DB Writer node since it doesn’t do a check if the table exists during execution.
Bye
Tobias
If you will bring both tables from your database, you can use a join node with the options to split the left, middle and right cases… if match you can use the db update node to select which one will stay/update at all. If left, is new from the file/table 1, if right it exists in your database/table 2 only… you can see it at the view output from the node and choose what you will do with it… it’s in your hands…