Skip to content

feat(sqla-core): Add support for rendering Database Specific queries #291

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 28, 2021
Merged

feat(sqla-core): Add support for rendering Database Specific queries #291

merged 5 commits into from
Apr 28, 2021

Conversation

antdking
Copy link
Contributor

@antdking antdking commented Apr 22, 2021

Issue: #290

Description of changes:

This makes the sqla-core plugin aware of how to compile a database specific query.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

fixes: #290

@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2021

Codecov Report

Merging #291 (71869d4) into master (d807884) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #291      +/-   ##
==========================================
+ Coverage   32.04%   32.16%   +0.12%     
==========================================
  Files          84       84              
  Lines        3305     3308       +3     
==========================================
+ Hits         1059     1064       +5     
+ Misses       2246     2244       -2     
Impacted Files Coverage Δ
aws_xray_sdk/ext/sqlalchemy_core/patch.py 77.02% <100.00%> (+3.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d807884...71869d4. Read the comment docs.

@antdking antdking marked this pull request as draft April 28, 2021 10:38
@antdking
Copy link
Contributor Author

antdking commented Apr 28, 2021

I'll restructure this PR after the sqla 1.4 PR is merged, as our test restructures will conflict pretty heavily

@srprash
Copy link
Contributor

srprash commented Apr 28, 2021

@cybojenix Thanks. I'll take a look once it is ready. :)

@antdking antdking marked this pull request as ready for review April 28, 2021 16:03
@antdking
Copy link
Contributor Author

Over to you, @srprash

Copy link
Contributor

@srprash srprash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment. Otherwise LGTM! Thanks!

@srprash
Copy link
Contributor

srprash commented Apr 28, 2021

And could you also update the branch? Thanks!

by default it runs 9.4.

We need to use a feature added in 9.5
This makes the sqla-core plugin aware of how to compile a database specific query.

It seems in some cases, we see strings come through (mostly pragma calls when doing 'create_all'),
so do a check to see if the object looks like a SQL Expression object.

Fixes: #290
this reduces duplication of the Engine fixture.
@antdking
Copy link
Contributor Author

Both addressed

@srprash
Copy link
Contributor

srprash commented Apr 28, 2021

Awesome! thanks

@srprash srprash merged commit bfe24c7 into aws:master Apr 28, 2021
Hargrav3s pushed a commit to Gavant/aws-xray-sdk-python that referenced this pull request Mar 22, 2022
…ws#291)

* chore(sqla_core): setup an area to run postgres tests

* fix: run a supported version of postgres in travis

by default it runs 9.4.

We need to use a feature added in 9.5

* feat(sqla-core): Add support for rendering Database Specific queries

This makes the sqla-core plugin aware of how to compile a database specific query.

It seems in some cases, we see strings come through (mostly pragma calls when doing 'create_all'),
so do a check to see if the object looks like a SQL Expression object.

Fixes: aws#290

* fix: remove a spurious 'self' in the fixtures

* chore: make the DB URL injectable

this reduces duplication of the Engine fixture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sqlalchemy_core: support stringifying queries for specific backends
3 participants