Originally created by @tbriggs2 on 2022-05-04 15:27:03
Summary
Most databases require a max length to be specified for varchar columns. Not all do (SQLite, Postgres, and Snowflake do not) but most do. The SDK currently creates varchar columns without a max length and thus table creation fails when the DB requires it. If the schema provided by the tap provides a max length it should be used.
Steps to reproduce
Create a SQL target using the SDK for a database such as MySQL
Feed the target data with a stream containing a string field where the schema record specifies a max length
What is the current bug behavior?
Creation of the table in the destination DB will fail due to a lack of a length.
What is the expected correct behavior?
If the tap provides a max length in the schema record it should be used.
Possible fixes
The relevant code is in singer_sdk/typing.py. MR incoming too.
Migrated from GitLab: https://gitlab.com/meltano/sdk/-/issues/371
Originally created by @tbriggs2 on 2022-05-04 15:27:03
Summary
Most databases require a max length to be specified for varchar columns. Not all do (SQLite, Postgres, and Snowflake do not) but most do. The SDK currently creates varchar columns without a max length and thus table creation fails when the DB requires it. If the schema provided by the tap provides a max length it should be used.
Steps to reproduce
What is the current bug behavior?
Creation of the table in the destination DB will fail due to a lack of a length.
What is the expected correct behavior?
If the tap provides a max length in the schema record it should be used.
Possible fixes
The relevant code is in singer_sdk/typing.py. MR incoming too.