SQL Targets: Processing of activate_version message assumes particular parameter markers
Summary
SQLSink.activate_version uses question marks as parameter markers in the query to update the sdc_deleted_at column. That's ok for some DBs but not all. I'm working with PyMySQL, for example, where that does not work.
Also, the code does not ensure the existence of the sdc_table_version field. That has to be resolved before the parameter markers become an issue.
Steps to reproduce
Run a pipeline where the tap produces an activate_version record, the target table already exists, and the DB driver doesn't use questions marks for parameter markers (e.g. MySQL).
What is the current bug behavior?
The UPDATE to set sdc_deleted_at fails.
What is the expected correct behavior?
The UPDATE to set sdc_deleted_at should succeed.
Possible fixes
SQLAlchemy's "text" method appears to be the better approach here. That solves the parameter marker problem and eliminates the use of the deprecated form of execute() the code currently uses.
MR incoming.