-
Notifications
You must be signed in to change notification settings - Fork 578
Port to psycopg3 #1324
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
Port to psycopg3 #1324
Conversation
|
@dvarrazzo Can you advise about Line 105 in 366c01b
Do we still need this, and what would be the equivalent in psycopg if yes? |
@j-bennet I seem to remember that you only use that function to actually disable json loading, by calling def register_typecasters(connection):
...
connection.adapters.register_loader("json", psycopg.types.string.TextLoader)
connection.adapters.register_loader("jsonb", psycopg.types.string.TextLoader)and to drop A function similar to the psycopg2 one is available as The exception checking in the old code is not necessary. It was necessary in the past to look for the oid of json/jsonb types, when they were still Postgres extensions. Now that they are in core, their oids are fixed and well known, so psycopg doesn't need to run queries which might fail. Even if you run pgcli with an old Postgres version, the function calls in |
0e32045 to
36b890a
Compare
|
This pull request introduces 2 alerts and fixes 3 when merging 36b890a into 372da81 - view on LGTM.com new alerts:
fixed alerts:
|
|
This pull request introduces 2 alerts and fixes 3 when merging 3217134 into 372da81 - view on LGTM.com new alerts:
fixed alerts:
|
Codecov Report
@@ Coverage Diff @@
## main #1324 +/- ##
==========================================
- Coverage 84.15% 79.13% -5.03%
==========================================
Files 21 23 +2
Lines 2720 2880 +160
==========================================
- Hits 2289 2279 -10
- Misses 431 601 +170
Continue to review full report at Codecov.
|
|
This pull request introduces 2 alerts and fixes 3 when merging 51459a5 into 372da81 - view on LGTM.com new alerts:
fixed alerts:
|
|
This pull request introduces 2 alerts and fixes 3 when merging a6188c4 into 372da81 - view on LGTM.com new alerts:
fixed alerts:
|
|
This pull request introduces 2 alerts and fixes 3 when merging e2584f3 into 372da81 - view on LGTM.com new alerts:
fixed alerts:
|
c57fe5d to
ad095b7
Compare
943aa0c to
edd3b49
Compare
|
This pull request fixes 3 alerts when merging edd3b49 into 372da81 - view on LGTM.com fixed alerts:
|
|
This pull request fixes 3 alerts when merging b581b75 into 372da81 - view on LGTM.com fixed alerts:
|
|
This pull request fixes 3 alerts when merging 840c6aa into 372da81 - view on LGTM.com fixed alerts:
|
|
This pull request fixes 3 alerts when merging 2c82435 into 372da81 - view on LGTM.com fixed alerts:
|
Description
Port pgcli to psycopg3. Work in progress.
Checklist
changelog.rst.AUTHORSfile (or it's already there).pip install pre-commit && pre-commit install), and ranblackon my code.