dbcli / pgspecial

Python implementation of postgres meta commands (backslash commands)
BSD 3-Clause "New" or "Revised" License
74 stars 54 forks source link

Port to psycopg3 #123

Closed j-bennet closed 2 years ago

j-bennet commented 2 years ago

Description

Since psycopg2 was split into 2 packages (source-only and binary-only package) starting from versions 2.8, we have not been able to provide pgcli users a simple way to choose whether they want to install one or the other, or provide a "default" and a "fallback" option. Now that psycopg3 is available, we can switch to that, and hopefully solve this problem once and for all.

For more context, see discussion here.

~Because psycopg3 only works with Python 3.7 and up, we have to drop support for Python 3.6 here. Which is fine, because EOL for Python 3.6 happened 2 months ago (December 23, 2021). But this is a breaking change, and I should bump the major version to release this.~

Checklist

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging c2e66d20db627c3aeb4f8396647ab504d2088df9 into 478c74dc35cb6e007ba431a9588c9bbd363f5942 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 626170530258611bf222789d2dd64765d988a214 into 478c74dc35cb6e007ba431a9588c9bbd363f5942 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging 0f196548714db6f3a3081b3dffa27bcc00d2609c into 478c74dc35cb6e007ba431a9588c9bbd363f5942 - view on LGTM.com

new alerts:

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@c479ddd). Click here to learn what that means. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #123   +/-   ##
=======================================
  Coverage        ?   19.93%           
=======================================
  Files           ?        6           
  Lines           ?     3747           
  Branches        ?        0           
=======================================
  Hits            ?      747           
  Misses          ?     3000           
  Partials        ?        0           

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 c479ddd...184f963. Read the comment docs.

j-bennet commented 2 years ago

@dvarrazzo I can't tag you to review, but I appreciate it if you could take a look.

dvarrazzo commented 2 years ago

Because psycopg3 only works with Python 3.7 and up,

Hi, @j-bennet,

Psycopg 3.0.x is still compatible with Python 3.6. only in the main branch, to be released as 3.1, we have dropped 3.6 support, see changelog.

I think you should be able to set a dependency on psycopg >= 3.0.10 for pgcli, which will work for python 3.6 too. That's still unreleased, but it should by the time this pgcli branch is ready. If you need a dev requirement, from the moment you can use the fix-231 branch for reasons already discussed, also working on python 3.6.

dvarrazzo commented 2 years ago

FYI, we have released psycopg 3.0.10, which fixes the Ctrl-C interaction and the error reported in the column names after copy.

SuperSandro2000 commented 2 years ago

I don't understand why this is marked as a breaking change in the changelog. I did some limited testing and so far everything just worked. There is also no mention of what exactly is the breaking change and how to update or I didn't find it.