This example pipeline demonstrates a complete
database workflow that creates a PostgreSQL table, populates it with
initial data, performs bulk upsert operations using CSV data, and
retrieves the final results. The pipeline showcases database table
management, data insertion, conditional updates, and data retrieval
operations in a sequential manner.
Download this pipeline.
- Configure the PostgreSQL - Multi Execute Snap to execute multiple SQL statements.
This includes dropping any existing target table,
creating a new table with columns for id,
name, quantity, and price, and inserting initial sample data records:
Apple, Banana, and Grapesrecords.
- Configure the
CSV Generator
Snap to generate CSV content containing product data with updated quantities and prices for both existing and new
items.
- Configure the PostgreSQL Bulk UpsertSnap to perform bulk upsert operations on thetarget_table in the public schema. Configure
the Delete upsert condition also.
- Validate the pipeline to perform bulk upsert operations.
The Snap performs bulk upsert operations on the
target_table using the CSV data, with id as key column, and includes a conditional delete
operation that removes records where id equals 5 and name equals Grapes. The output
displays the details of the updated, inserted, and deleted records.
- Verify the results using PostgreSQL - Select Snap.
After validation, all records from the target table are updated, and the data can be further
used for other downstream operations.