Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(targets): Quote add-column-ddl with column starting with _ (underscore) based on engine #2583

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

haleemur
Copy link
Contributor

@haleemur haleemur commented Aug 2, 2024

Description

Pass the compiled string output to the DDL element constructor.

This ensures that the compilation is engine specific and engine specific quoting rules are respected.

Passing the compiler element to the context sa.DDL does not yield proper engine-specific quoting.

Some databases (e.g. IBM Db2, and maybe others as well) require fields starting with underscore (e.g. _id) to be quoted, while other databases (postgres, sqlite) accept fields with leading underscores without quotes.

Testing

Updated schema evolution test in testing/target_test_streams to ensure any downstream target is also tested for scenario: add column starting with underscore.

Added scenario: add column starting with underscore to the sqlite sample target test.


📚 Documentation preview 📚: https://meltano-sdk--2583.org.readthedocs.build/en/2583/

Copy link

codspeed-hq bot commented Aug 2, 2024

CodSpeed Performance Report

Merging #2583 will not alter performance

Comparing haleemur:fix-add-column-quoting (2676bc4) with main (278fde4)

Summary

✅ 6 untouched benchmarks

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.47%. Comparing base (278fde4) to head (2676bc4).
Report is 118 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2583   +/-   ##
=======================================
  Coverage   89.47%   89.47%           
=======================================
  Files          58       58           
  Lines        4798     4798           
  Branches      936      936           
=======================================
  Hits         4293     4293           
  Misses        352      352           
  Partials      153      153           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@haleemur haleemur changed the title fix(target): DDL for add column starting with _ (underscore) is quoted based on engine fix(targets): Quote add-column-ddl with column starting with _ (underscore) based on engine Aug 2, 2024
@haleemur haleemur changed the title fix(targets): Quote add-column-ddl with column starting with _ (underscore) based on engine draft: fix(targets): Quote add-column-ddl with column starting with _ (underscore) based on engine Aug 2, 2024
@haleemur haleemur changed the title draft: fix(targets): Quote add-column-ddl with column starting with _ (underscore) based on engine fix(targets): Quote add-column-ddl with column starting with _ (underscore) based on engine Aug 2, 2024
@edgarrmondragon edgarrmondragon added this pull request to the merge queue Aug 5, 2024
@edgarrmondragon
Copy link
Collaborator

Thanks @haleemur!

Merged via the queue into meltano:main with commit 81d91f3 Aug 5, 2024
31 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants