Reputation: 1
I need something like a listener which listens to changes in the database. As soon as some change occurs, it inserts the updated row in the pubSub queue. What is the best way to do this?
Upvotes: 0
Views: 1340
Reputation: 3512
It's still in alpha stage, but you could have a look at this: https://github.com/cloudspannerecosystem/spanner-change-watcher
It's a generic framework for watching a Spanner database for changes by polling tables for new commit timestamps. It does require the tables that you want to watch for changes to contain a column with the option ALLOW_COMMIT_TIMESTAMP=TRUE
and for this column to be filled.
It contains three main modules:
Upvotes: 1