
Operations to capture
When configuring a sink, you can specify which Postgres operations to capture:insert
update
delete
If you backfill a table to a sink, Sequin will send
read
messages for each row in the table, regardless of which operations you specify.Filter functions
Filter functions provide more advanced filtering capabilities than what’s possible with column filters alone. They allow you to:- Apply complex conditional logic to your data
- Compare new and old values for changed rows
- Use string pattern matching or regular expressions
- Implement custom business logic for filtering
true
or false
). Filter functions that return non-boolean values will fail to execute.
How filter functions work
When you create a filter function, you define an Elixir function that evaluates whether a message should be processed. For each message, your filter function receives:action
: The operation type (e.g., “insert”, “update”, “delete”)record
: The full row/record data as a map with string keyschanges
: For update operations, contains the old values that were changedmetadata
: Additional information like table name, timestamp, etc.
How filters are combined
When you set up a sink with multiple types of filters, all filters are applied with a logical AND. This means the operation must match one of the selected operations (insert, update, delete) and the filter function (if specified) must returntrue
.
If any of these conditions fail, the message will not be delivered to the sink.