Skip to content
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

fix psycopg.sql.Identifier in \ev handling #1384

Merged
merged 1 commit into from Nov 22, 2022

Conversation

andyscho
Copy link
Contributor

@andyscho andyscho commented Nov 20, 2022

Description

This fixes the issue outlined in #1372 by changing the psycopg.sql.Identifier. I would guess this problem originally entered the codebase relatively recently during the port to psycopg3.

Before this PR, CREATE OR REPLACE VIEW will not replace the view, and will instead create a new view with the name <schema>.<view>, leaving the original view unchanged.

Adds extremely small test assertion to make sure the view is quoted correctly.

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install), and ran black on my code.
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2022

Codecov Report

Base: 84.15% // Head: 80.07% // Decreases project coverage by -4.07% ⚠️

Coverage data is based on head (4fd7feb) compared to base (6884c29).
Patch coverage: 47.71% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1384      +/-   ##
==========================================
- Coverage   84.15%   80.07%   -4.08%     
==========================================
  Files          21       23       +2     
  Lines        2720     2148     -572     
==========================================
- Hits         2289     1720     -569     
+ Misses        431      428       -3     
Impacted Files Coverage Δ
pgcli/magic.py 0.00% <0.00%> (ø)
pgcli/packages/parseutils/tables.py 97.67% <ø> (ø)
pgcli/packages/sqlcompletion.py 97.67% <ø> (ø)
pgcli/pgstyle.py 64.00% <ø> (ø)
pgcli/pgtoolbar.py 31.57% <0.00%> (+0.15%) ⬆️
pgcli/pyev.py 15.38% <15.38%> (ø)
pgcli/explain_output_formatter.py 46.15% <46.15%> (ø)
pgcli/key_bindings.py 52.94% <66.66%> (-0.19%) ⬇️
pgcli/pgbuffer.py 67.85% <66.66%> (+1.19%) ⬆️
pgcli/pgexecute.py 83.22% <87.14%> (+2.86%) ⬆️
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@j-bennet
Copy link
Contributor

j-bennet commented Nov 22, 2022

Nice work @andyscho .

@j-bennet j-bennet merged commit 2db54f1 into dbcli:main Nov 22, 2022
8 checks passed
rob-b pushed a commit to rob-b/pgcli that referenced this pull request Nov 23, 2022
rob-b pushed a commit to rob-b/pgcli that referenced this pull request Nov 23, 2022
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.

None yet

3 participants