How to make the stream schema dynamic? #238
-
I'm building replication from MySQL transactional db to Postgres, and it turned out that the db I can use for dev/testing purposes is named differently from the final (eg. Is there a way to define the schema somewhere and use interpolation in the stream keys? Something like streams:
{schema_from_envvar}.my_table:
... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Just checked over the logic, the stream name doesn't get formatted, so it won't work. I'll enable that next release. As a workaround, try this (the custom SQL does get formatted): defaults:
sql: "select * from {schema}.{stream_name}"
streams:
my_table:
env:
schema: '${SCHEMA}' # From Environment |
Beta Was this translation helpful? Give feedback.
Just checked over the logic, the stream name doesn't get formatted, so it won't work. I'll enable that next release.
As a workaround, try this (the custom SQL does get formatted):