mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-10 23:50:12 +00:00
Upgrade to psycopg3
This commit is contained in:
parent
b0401ffd4d
commit
c262a65e7e
31 changed files with 272 additions and 228 deletions
backend
docker
requirements
src/baserow
cachalot_patch.py
contrib/database
data_sync
db
fields
formula/expression_generator
migrations
search
table
views
core
test_utils
tests/baserow
changelog/entries/unreleased/refactor
docs/development
plugin-boilerplate/{{ cookiecutter.project_slug }}/plugins/{{ cookiecutter.project_module }}/backend/requirements
premium/backend/src/baserow_premium/migrations
|
@ -55,7 +55,7 @@ DATABASE_PASSWORD=$DATABASE_PASSWORD \
|
|||
DATABASE_OPTIONS=$DATABASE_OPTIONS \
|
||||
python3 << END
|
||||
import sys
|
||||
import psycopg2
|
||||
import psycopg
|
||||
import json
|
||||
import os
|
||||
DATABASE_NAME=os.getenv('DATABASE_NAME')
|
||||
|
@ -66,7 +66,7 @@ DATABASE_PASSWORD=os.getenv('DATABASE_PASSWORD')
|
|||
DATABASE_OPTIONS=os.getenv('DATABASE_OPTIONS')
|
||||
try:
|
||||
options = json.loads(DATABASE_OPTIONS or "{}")
|
||||
psycopg2.connect(
|
||||
psycopg.connect(
|
||||
dbname=DATABASE_NAME,
|
||||
user=DATABASE_USER,
|
||||
password=DATABASE_PASSWORD,
|
||||
|
@ -80,7 +80,7 @@ except Exception as e:
|
|||
print(e)
|
||||
print("Trying again without any DATABASE_OPTIONS:")
|
||||
try:
|
||||
psycopg2.connect(
|
||||
psycopg.connect(
|
||||
dbname=DATABASE_NAME,
|
||||
user=DATABASE_USER,
|
||||
password=DATABASE_PASSWORD,
|
||||
|
@ -99,14 +99,14 @@ else
|
|||
DATABASE_URL=$DATABASE_URL \
|
||||
python3 << END
|
||||
import sys
|
||||
import psycopg2
|
||||
import psycopg
|
||||
import os
|
||||
DATABASE_URL=os.getenv('DATABASE_URL')
|
||||
try:
|
||||
psycopg2.connect(
|
||||
psycopg.connect(
|
||||
DATABASE_URL
|
||||
)
|
||||
except psycopg2.OperationalError as e:
|
||||
except psycopg.OperationalError as e:
|
||||
print(f"Error: Failed to connect to the postgresql database at {DATABASE_URL}")
|
||||
print("Please see the error below for more details:")
|
||||
print(e)
|
||||
|
|
|
@ -2,7 +2,8 @@ django==5.0.9
|
|||
django-cors-headers==4.3.1
|
||||
djangorestframework==3.15.1
|
||||
djangorestframework-simplejwt==5.3.1
|
||||
psycopg2==2.9.9
|
||||
psycopg==3.2.3
|
||||
psycopg-binary==3.2.3
|
||||
Faker==25.0.1
|
||||
Twisted==24.3.0
|
||||
gunicorn==22.0.0
|
||||
|
@ -39,25 +40,25 @@ redis==5.0.4
|
|||
pysaml2==7.5.0
|
||||
validators==0.28.1
|
||||
requests-oauthlib==2.0.0
|
||||
opentelemetry-api==1.24.0
|
||||
opentelemetry-exporter-otlp-proto-http==1.24.0
|
||||
opentelemetry-instrumentation==0.45b0
|
||||
opentelemetry-instrumentation-django==0.45b0
|
||||
opentelemetry-instrumentation-aiohttp-client==0.45b0
|
||||
opentelemetry-instrumentation-asgi==0.45b0
|
||||
opentelemetry-instrumentation-botocore==0.45b0
|
||||
opentelemetry-instrumentation-celery==0.45b0
|
||||
opentelemetry-instrumentation-dbapi==0.45b0
|
||||
opentelemetry-instrumentation-grpc==0.45b0
|
||||
opentelemetry-instrumentation-logging==0.45b0
|
||||
opentelemetry-instrumentation-psycopg2==0.45b0
|
||||
opentelemetry-instrumentation-redis==0.45b0
|
||||
opentelemetry-instrumentation-requests==0.45b0
|
||||
opentelemetry-instrumentation-wsgi==0.45b0
|
||||
opentelemetry-proto==1.24.0
|
||||
opentelemetry-sdk==1.24.0
|
||||
opentelemetry-semantic-conventions==0.45b0
|
||||
opentelemetry-util-http==0.45b0
|
||||
opentelemetry-api==1.29.0
|
||||
opentelemetry-exporter-otlp-proto-http==1.29.0
|
||||
opentelemetry-instrumentation==0.50b0
|
||||
opentelemetry-instrumentation-django==0.50b0
|
||||
opentelemetry-instrumentation-aiohttp-client==0.50b0
|
||||
opentelemetry-instrumentation-asgi==0.50b0
|
||||
opentelemetry-instrumentation-botocore==0.50b0
|
||||
opentelemetry-instrumentation-celery==0.50b0
|
||||
opentelemetry-instrumentation-dbapi==0.50b0
|
||||
opentelemetry-instrumentation-grpc==0.50b0
|
||||
opentelemetry-instrumentation-logging==0.50b0
|
||||
opentelemetry-instrumentation-redis==0.50b0
|
||||
opentelemetry-instrumentation-psycopg==0.50b0
|
||||
opentelemetry-instrumentation-requests==0.50b0
|
||||
opentelemetry-instrumentation-wsgi==0.50b0
|
||||
opentelemetry-proto==1.29.0
|
||||
opentelemetry-sdk==1.29.0
|
||||
opentelemetry-semantic-conventions==0.50b0
|
||||
opentelemetry-util-http==0.50b0
|
||||
Brotli==1.1.0
|
||||
loguru==0.7.2
|
||||
django-cachalot==2.6.2
|
||||
|
|
|
@ -6,13 +6,15 @@
|
|||
#
|
||||
advocate==1.0.0
|
||||
# via -r base.in
|
||||
aiohttp==3.9.5
|
||||
aiohappyeyeballs==2.4.4
|
||||
# via aiohttp
|
||||
aiohttp==3.11.11
|
||||
# via
|
||||
# langchain
|
||||
# langchain-community
|
||||
aiosignal==1.3.1
|
||||
aiosignal==1.3.2
|
||||
# via aiohttp
|
||||
amqp==5.2.0
|
||||
amqp==5.3.1
|
||||
# via kombu
|
||||
annotated-types==0.7.0
|
||||
# via pydantic
|
||||
|
@ -20,7 +22,7 @@ anthropic==0.37.1
|
|||
# via -r base.in
|
||||
antlr4-python3-runtime==4.9.3
|
||||
# via -r base.in
|
||||
anyio==4.4.0
|
||||
anyio==4.8.0
|
||||
# via
|
||||
# anthropic
|
||||
# httpx
|
||||
|
@ -35,38 +37,37 @@ asgiref==3.8.1
|
|||
# django
|
||||
# django-cors-headers
|
||||
# opentelemetry-instrumentation-asgi
|
||||
async-timeout==4.0.3
|
||||
async-timeout==5.0.1
|
||||
# via redis
|
||||
attrs==23.2.0
|
||||
attrs==24.3.0
|
||||
# via
|
||||
# aiohttp
|
||||
# automat
|
||||
# jsonschema
|
||||
# service-identity
|
||||
# twisted
|
||||
autobahn==23.6.2
|
||||
autobahn==24.4.2
|
||||
# via daphne
|
||||
automat==22.10.0
|
||||
automat==24.8.1
|
||||
# via twisted
|
||||
azure-core==1.30.1
|
||||
azure-core==1.32.0
|
||||
# via
|
||||
# azure-storage-blob
|
||||
# django-storages
|
||||
azure-storage-blob==12.20.0
|
||||
azure-storage-blob==12.24.0
|
||||
# via django-storages
|
||||
backoff==2.2.1
|
||||
# via posthog
|
||||
billiard==4.2.0
|
||||
billiard==4.2.1
|
||||
# via celery
|
||||
boto3==1.34.98
|
||||
# via -r base.in
|
||||
botocore==1.34.119
|
||||
botocore==1.34.162
|
||||
# via
|
||||
# boto3
|
||||
# s3transfer
|
||||
brotli==1.1.0
|
||||
# via -r base.in
|
||||
cachetools==5.3.3
|
||||
cachetools==5.5.0
|
||||
# via google-auth
|
||||
celery[redis]==5.4.0
|
||||
# via
|
||||
|
@ -80,13 +81,13 @@ celery-redbeat==2.2.0
|
|||
# via -r base.in
|
||||
celery-singleton==0.3.1
|
||||
# via -r base.in
|
||||
certifi==2024.6.2
|
||||
certifi==2024.12.14
|
||||
# via
|
||||
# httpcore
|
||||
# httpx
|
||||
# requests
|
||||
# sentry-sdk
|
||||
cffi==1.16.0
|
||||
cffi==1.17.1
|
||||
# via cryptography
|
||||
channels[daphne]==4.0.0
|
||||
# via
|
||||
|
@ -94,9 +95,9 @@ channels[daphne]==4.0.0
|
|||
# channels-redis
|
||||
channels-redis==4.1.0
|
||||
# via -r base.in
|
||||
charset-normalizer==3.3.2
|
||||
charset-normalizer==3.4.1
|
||||
# via requests
|
||||
click==8.1.7
|
||||
click==8.1.8
|
||||
# via
|
||||
# celery
|
||||
# click-didyoumean
|
||||
|
@ -111,9 +112,9 @@ click-repl==0.3.0
|
|||
# via celery
|
||||
constantly==23.10.4
|
||||
# via twisted
|
||||
cron-descriptor==1.4.3
|
||||
cron-descriptor==1.4.5
|
||||
# via django-celery-beat
|
||||
cryptography==42.0.8
|
||||
cryptography==44.0.0
|
||||
# via
|
||||
# autobahn
|
||||
# azure-storage-blob
|
||||
|
@ -122,16 +123,17 @@ cryptography==42.0.8
|
|||
# service-identity
|
||||
daphne==4.1.2
|
||||
# via channels
|
||||
dataclasses-json==0.6.6
|
||||
dataclasses-json==0.6.7
|
||||
# via
|
||||
# langchain
|
||||
# langchain-community
|
||||
defusedxml==0.7.1
|
||||
# via pysaml2
|
||||
deprecated==1.2.14
|
||||
deprecated==1.2.15
|
||||
# via
|
||||
# opentelemetry-api
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
# opentelemetry-semantic-conventions
|
||||
distro==1.9.0
|
||||
# via
|
||||
# anthropic
|
||||
|
@ -171,7 +173,7 @@ django-redis==5.4.0
|
|||
# via -r base.in
|
||||
django-storages[azure,google]==1.14.3
|
||||
# via -r base.in
|
||||
django-timezone-field==6.1.0
|
||||
django-timezone-field==7.0
|
||||
# via django-celery-beat
|
||||
djangorestframework==3.15.1
|
||||
# via
|
||||
|
@ -182,11 +184,11 @@ djangorestframework-simplejwt==5.3.1
|
|||
# via -r base.in
|
||||
drf-spectacular==0.27.2
|
||||
# via -r base.in
|
||||
elementpath==4.4.0
|
||||
elementpath==4.7.0
|
||||
# via xmlschema
|
||||
et-xmlfile==2.0.0
|
||||
# via openpyxl
|
||||
eval-type-backport==0.2.0
|
||||
eval-type-backport==0.2.2
|
||||
# via mistralai
|
||||
faker==25.0.1
|
||||
# via -r base.in
|
||||
|
@ -194,36 +196,36 @@ filelock==3.16.1
|
|||
# via huggingface-hub
|
||||
flower==2.0.1
|
||||
# via -r base.in
|
||||
frozenlist==1.4.1
|
||||
frozenlist==1.5.0
|
||||
# via
|
||||
# aiohttp
|
||||
# aiosignal
|
||||
fsspec==2024.10.0
|
||||
fsspec==2024.12.0
|
||||
# via huggingface-hub
|
||||
google-api-core==2.19.0
|
||||
google-api-core==2.24.0
|
||||
# via
|
||||
# google-cloud-core
|
||||
# google-cloud-storage
|
||||
google-auth==2.29.0
|
||||
google-auth==2.37.0
|
||||
# via
|
||||
# google-api-core
|
||||
# google-cloud-core
|
||||
# google-cloud-storage
|
||||
google-cloud-core==2.4.1
|
||||
# via google-cloud-storage
|
||||
google-cloud-storage==2.16.0
|
||||
google-cloud-storage==2.19.0
|
||||
# via django-storages
|
||||
google-crc32c==1.5.0
|
||||
google-crc32c==1.6.0
|
||||
# via
|
||||
# google-cloud-storage
|
||||
# google-resumable-media
|
||||
google-resumable-media==2.7.0
|
||||
google-resumable-media==2.7.2
|
||||
# via google-cloud-storage
|
||||
googleapis-common-protos==1.63.1
|
||||
googleapis-common-protos==1.66.0
|
||||
# via
|
||||
# google-api-core
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
greenlet==3.0.3
|
||||
greenlet==3.1.1
|
||||
# via sqlalchemy
|
||||
gunicorn==22.0.0
|
||||
# via -r base.in
|
||||
|
@ -231,19 +233,20 @@ h11==0.14.0
|
|||
# via
|
||||
# httpcore
|
||||
# uvicorn
|
||||
httpcore==1.0.5
|
||||
httpcore==1.0.7
|
||||
# via httpx
|
||||
httptools==0.6.1
|
||||
httptools==0.6.4
|
||||
# via uvicorn
|
||||
httpx==0.27.0
|
||||
httpx==0.27.2
|
||||
# via
|
||||
# anthropic
|
||||
# langsmith
|
||||
# mistralai
|
||||
# ollama
|
||||
# openai
|
||||
huggingface-hub==0.26.1
|
||||
huggingface-hub==0.27.1
|
||||
# via tokenizers
|
||||
humanize==4.9.0
|
||||
humanize==4.11.0
|
||||
# via flower
|
||||
hyperlink==21.0.0
|
||||
# via
|
||||
|
@ -251,7 +254,7 @@ hyperlink==21.0.0
|
|||
# twisted
|
||||
icalendar==5.0.12
|
||||
# via -r base.in
|
||||
idna==3.7
|
||||
idna==3.10
|
||||
# via
|
||||
# anyio
|
||||
# httpx
|
||||
|
@ -259,19 +262,19 @@ idna==3.7
|
|||
# requests
|
||||
# twisted
|
||||
# yarl
|
||||
importlib-metadata==7.0.0
|
||||
importlib-metadata==8.4.0
|
||||
# via opentelemetry-api
|
||||
incremental==22.10.0
|
||||
incremental==24.7.2
|
||||
# via twisted
|
||||
inflection==0.5.1
|
||||
# via drf-spectacular
|
||||
isodate==0.6.1
|
||||
isodate==0.7.2
|
||||
# via azure-storage-blob
|
||||
itsdangerous==2.2.0
|
||||
# via -r base.in
|
||||
jira2markdown==0.3.7
|
||||
# via -r base.in
|
||||
jiter==0.6.1
|
||||
jiter==0.8.2
|
||||
# via anthropic
|
||||
jmespath==1.0.1
|
||||
# via
|
||||
|
@ -283,26 +286,26 @@ jsonpatch==1.33
|
|||
# langchain-core
|
||||
jsonpath-python==1.0.6
|
||||
# via mistralai
|
||||
jsonpointer==2.4
|
||||
jsonpointer==3.0.0
|
||||
# via jsonpatch
|
||||
jsonschema==4.17.3
|
||||
# via
|
||||
# -r base.in
|
||||
# drf-spectacular
|
||||
kombu==5.3.7
|
||||
kombu==5.4.2
|
||||
# via celery
|
||||
langchain==0.1.17
|
||||
# via -r base.in
|
||||
langchain-community==0.0.38
|
||||
# via langchain
|
||||
langchain-core==0.1.52
|
||||
langchain-core==0.1.53
|
||||
# via
|
||||
# langchain
|
||||
# langchain-community
|
||||
# langchain-text-splitters
|
||||
langchain-text-splitters==0.0.2
|
||||
# via langchain
|
||||
langsmith==0.1.71
|
||||
langsmith==0.1.147
|
||||
# via
|
||||
# langchain
|
||||
# langchain-community
|
||||
|
@ -311,7 +314,7 @@ loguru==0.7.2
|
|||
# via -r base.in
|
||||
markdown-it-py==3.0.0
|
||||
# via rich
|
||||
marshmallow==3.21.2
|
||||
marshmallow==3.24.1
|
||||
# via dataclasses-json
|
||||
mdurl==0.1.2
|
||||
# via markdown-it-py
|
||||
|
@ -319,9 +322,9 @@ mistralai==1.1.0
|
|||
# via -r base.in
|
||||
monotonic==1.6
|
||||
# via posthog
|
||||
msgpack==1.0.8
|
||||
msgpack==1.1.0
|
||||
# via channels-redis
|
||||
multidict==6.0.5
|
||||
multidict==6.1.0
|
||||
# via
|
||||
# aiohttp
|
||||
# yarl
|
||||
|
@ -343,7 +346,7 @@ openai==1.30.1
|
|||
# via -r base.in
|
||||
openpyxl==3.1.5
|
||||
# via -r base.in
|
||||
opentelemetry-api==1.24.0
|
||||
opentelemetry-api==1.29.0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
|
@ -356,17 +359,18 @@ opentelemetry-api==1.24.0
|
|||
# opentelemetry-instrumentation-django
|
||||
# opentelemetry-instrumentation-grpc
|
||||
# opentelemetry-instrumentation-logging
|
||||
# opentelemetry-instrumentation-psycopg2
|
||||
# opentelemetry-instrumentation-psycopg
|
||||
# opentelemetry-instrumentation-redis
|
||||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
# opentelemetry-propagator-aws-xray
|
||||
# opentelemetry-sdk
|
||||
opentelemetry-exporter-otlp-proto-common==1.24.0
|
||||
# opentelemetry-semantic-conventions
|
||||
opentelemetry-exporter-otlp-proto-common==1.29.0
|
||||
# via opentelemetry-exporter-otlp-proto-http
|
||||
opentelemetry-exporter-otlp-proto-http==1.24.0
|
||||
opentelemetry-exporter-otlp-proto-http==1.29.0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation==0.45b0
|
||||
opentelemetry-instrumentation==0.50b0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-instrumentation-aiohttp-client
|
||||
|
@ -377,53 +381,53 @@ opentelemetry-instrumentation==0.45b0
|
|||
# opentelemetry-instrumentation-django
|
||||
# opentelemetry-instrumentation-grpc
|
||||
# opentelemetry-instrumentation-logging
|
||||
# opentelemetry-instrumentation-psycopg2
|
||||
# opentelemetry-instrumentation-psycopg
|
||||
# opentelemetry-instrumentation-redis
|
||||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
opentelemetry-instrumentation-aiohttp-client==0.45b0
|
||||
opentelemetry-instrumentation-aiohttp-client==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-asgi==0.45b0
|
||||
opentelemetry-instrumentation-asgi==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-botocore==0.45b0
|
||||
opentelemetry-instrumentation-botocore==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-celery==0.45b0
|
||||
opentelemetry-instrumentation-celery==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-dbapi==0.45b0
|
||||
opentelemetry-instrumentation-dbapi==0.50b0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-instrumentation-psycopg2
|
||||
opentelemetry-instrumentation-django==0.45b0
|
||||
# opentelemetry-instrumentation-psycopg
|
||||
opentelemetry-instrumentation-django==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-grpc==0.45b0
|
||||
opentelemetry-instrumentation-grpc==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-logging==0.45b0
|
||||
opentelemetry-instrumentation-logging==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-psycopg2==0.45b0
|
||||
opentelemetry-instrumentation-psycopg==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-redis==0.45b0
|
||||
opentelemetry-instrumentation-redis==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-requests==0.45b0
|
||||
opentelemetry-instrumentation-requests==0.50b0
|
||||
# via -r base.in
|
||||
opentelemetry-instrumentation-wsgi==0.45b0
|
||||
opentelemetry-instrumentation-wsgi==0.50b0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-instrumentation-django
|
||||
opentelemetry-propagator-aws-xray==1.0.1
|
||||
opentelemetry-propagator-aws-xray==1.0.2
|
||||
# via opentelemetry-instrumentation-botocore
|
||||
opentelemetry-proto==1.24.0
|
||||
opentelemetry-proto==1.29.0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-exporter-otlp-proto-common
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
opentelemetry-sdk==1.24.0
|
||||
opentelemetry-sdk==1.29.0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
# opentelemetry-instrumentation-grpc
|
||||
opentelemetry-semantic-conventions==0.45b0
|
||||
opentelemetry-semantic-conventions==0.50b0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-instrumentation
|
||||
# opentelemetry-instrumentation-aiohttp-client
|
||||
# opentelemetry-instrumentation-asgi
|
||||
# opentelemetry-instrumentation-botocore
|
||||
|
@ -435,7 +439,7 @@ opentelemetry-semantic-conventions==0.45b0
|
|||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
# opentelemetry-sdk
|
||||
opentelemetry-util-http==0.45b0
|
||||
opentelemetry-util-http==0.50b0
|
||||
# via
|
||||
# -r base.in
|
||||
# opentelemetry-instrumentation-aiohttp-client
|
||||
|
@ -443,7 +447,7 @@ opentelemetry-util-http==0.45b0
|
|||
# opentelemetry-instrumentation-django
|
||||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
orjson==3.10.3
|
||||
orjson==3.10.13
|
||||
# via langsmith
|
||||
packaging==23.2
|
||||
# via
|
||||
|
@ -451,19 +455,24 @@ packaging==23.2
|
|||
# huggingface-hub
|
||||
# langchain-core
|
||||
# marshmallow
|
||||
# opentelemetry-instrumentation
|
||||
pillow==10.3.0
|
||||
# via -r base.in
|
||||
posthog==3.5.0
|
||||
# via -r base.in
|
||||
prometheus-client==0.20.0
|
||||
prometheus-client==0.21.1
|
||||
# via flower
|
||||
prompt-toolkit==3.0.46
|
||||
prompt-toolkit==3.0.48
|
||||
# via click-repl
|
||||
propcache==0.2.1
|
||||
# via
|
||||
# aiohttp
|
||||
# yarl
|
||||
prosemirror @ https://github.com/fellowapp/prosemirror-py/archive/refs/tags/v0.3.5.zip
|
||||
# via -r base.in
|
||||
proto-plus==1.23.0
|
||||
proto-plus==1.25.0
|
||||
# via google-api-core
|
||||
protobuf==4.25.3
|
||||
protobuf==5.29.2
|
||||
# via
|
||||
# google-api-core
|
||||
# googleapis-common-protos
|
||||
|
@ -471,16 +480,18 @@ protobuf==4.25.3
|
|||
# proto-plus
|
||||
psutil==5.9.8
|
||||
# via -r base.in
|
||||
psycopg2==2.9.9
|
||||
psycopg==3.2.3
|
||||
# via -r base.in
|
||||
pyasn1==0.6.0
|
||||
psycopg-binary==3.2.3
|
||||
# via -r base.in
|
||||
pyasn1==0.6.1
|
||||
# via
|
||||
# advocate
|
||||
# ndg-httpsclient
|
||||
# pyasn1-modules
|
||||
# rsa
|
||||
# service-identity
|
||||
pyasn1-modules==0.4.0
|
||||
pyasn1-modules==0.4.1
|
||||
# via
|
||||
# google-auth
|
||||
# service-identity
|
||||
|
@ -496,23 +507,23 @@ pydantic==2.9.2
|
|||
# openai
|
||||
pydantic-core==2.23.4
|
||||
# via pydantic
|
||||
pygments==2.18.0
|
||||
pygments==2.19.1
|
||||
# via rich
|
||||
pyjwt==2.8.0
|
||||
pyjwt==2.10.1
|
||||
# via djangorestframework-simplejwt
|
||||
pyopenssl==24.1.0
|
||||
pyopenssl==24.3.0
|
||||
# via
|
||||
# advocate
|
||||
# ndg-httpsclient
|
||||
# pysaml2
|
||||
# twisted
|
||||
pyparsing==3.2.0
|
||||
pyparsing==3.2.1
|
||||
# via jira2markdown
|
||||
pyrsistent==0.20.0
|
||||
# via jsonschema
|
||||
pysaml2==7.5.0
|
||||
# via -r base.in
|
||||
python-crontab==3.1.0
|
||||
python-crontab==3.2.0
|
||||
# via django-celery-beat
|
||||
python-dateutil==2.8.2
|
||||
# via
|
||||
|
@ -527,12 +538,12 @@ python-dateutil==2.8.2
|
|||
# python-crontab
|
||||
python-dotenv==1.0.1
|
||||
# via uvicorn
|
||||
pytz==2024.1
|
||||
pytz==2024.2
|
||||
# via
|
||||
# flower
|
||||
# icalendar
|
||||
# pysaml2
|
||||
pyyaml==6.0.1
|
||||
pyyaml==6.0.2
|
||||
# via
|
||||
# drf-spectacular
|
||||
# huggingface-hub
|
||||
|
@ -565,13 +576,16 @@ requests==2.31.0
|
|||
# posthog
|
||||
# pysaml2
|
||||
# requests-oauthlib
|
||||
# requests-toolbelt
|
||||
requests-oauthlib==2.0.0
|
||||
# via -r base.in
|
||||
requests-toolbelt==1.0.0
|
||||
# via langsmith
|
||||
rich==13.7.1
|
||||
# via -r base.in
|
||||
rsa==4.9
|
||||
# via google-auth
|
||||
s3transfer==0.10.1
|
||||
s3transfer==0.10.4
|
||||
# via boto3
|
||||
sentry-sdk==2.0.1
|
||||
# via -r base.in
|
||||
|
@ -579,12 +593,10 @@ service-identity==24.1.0
|
|||
# via
|
||||
# -r base.in
|
||||
# twisted
|
||||
six==1.16.0
|
||||
six==1.17.0
|
||||
# via
|
||||
# advocate
|
||||
# automat
|
||||
# azure-core
|
||||
# isodate
|
||||
# posthog
|
||||
# python-dateutil
|
||||
sniffio==1.3.1
|
||||
|
@ -593,21 +605,21 @@ sniffio==1.3.1
|
|||
# anyio
|
||||
# httpx
|
||||
# openai
|
||||
sqlalchemy==2.0.30
|
||||
sqlalchemy==2.0.36
|
||||
# via
|
||||
# langchain
|
||||
# langchain-community
|
||||
sqlparse==0.5.0
|
||||
sqlparse==0.5.3
|
||||
# via django
|
||||
tenacity==8.3.0
|
||||
tenacity==8.5.0
|
||||
# via
|
||||
# celery-redbeat
|
||||
# langchain
|
||||
# langchain-community
|
||||
# langchain-core
|
||||
tokenizers==0.20.1
|
||||
tokenizers==0.21.0
|
||||
# via anthropic
|
||||
tornado==6.4.1
|
||||
tornado==6.4.2
|
||||
# via flower
|
||||
tqdm==4.66.4
|
||||
# via
|
||||
|
@ -624,6 +636,7 @@ typing-extensions==4.11.0
|
|||
# via
|
||||
# -r base.in
|
||||
# anthropic
|
||||
# anyio
|
||||
# azure-core
|
||||
# azure-storage-blob
|
||||
# dj-database-url
|
||||
|
@ -631,6 +644,7 @@ typing-extensions==4.11.0
|
|||
# openai
|
||||
# opentelemetry-sdk
|
||||
# prosemirror
|
||||
# psycopg
|
||||
# pydantic
|
||||
# pydantic-core
|
||||
# sqlalchemy
|
||||
|
@ -645,11 +659,12 @@ tzdata==2024.1
|
|||
# -r base.in
|
||||
# celery
|
||||
# django-celery-beat
|
||||
# kombu
|
||||
unicodecsv==0.14.1
|
||||
# via -r base.in
|
||||
uritemplate==4.1.1
|
||||
# via drf-spectacular
|
||||
urllib3==1.26.18
|
||||
urllib3==1.26.20
|
||||
# via
|
||||
# advocate
|
||||
# botocore
|
||||
|
@ -657,7 +672,7 @@ urllib3==1.26.18
|
|||
# sentry-sdk
|
||||
uvicorn[standard]==0.29.0
|
||||
# via -r base.in
|
||||
uvloop==0.19.0
|
||||
uvloop==0.21.0
|
||||
# via uvicorn
|
||||
validators==0.28.1
|
||||
# via -r base.in
|
||||
|
@ -666,7 +681,7 @@ vine==5.1.0
|
|||
# amqp
|
||||
# celery
|
||||
# kombu
|
||||
watchfiles==0.22.0
|
||||
watchfiles==1.0.3
|
||||
# via uvicorn
|
||||
wcwidth==0.2.13
|
||||
# via prompt-toolkit
|
||||
|
@ -674,7 +689,7 @@ websockets==12.0
|
|||
# via
|
||||
# -r base.in
|
||||
# uvicorn
|
||||
wrapt==1.16.0
|
||||
wrapt==1.17.0
|
||||
# via
|
||||
# deprecated
|
||||
# opentelemetry-instrumentation
|
||||
|
@ -684,7 +699,7 @@ wrapt==1.16.0
|
|||
# opentelemetry-instrumentation-redis
|
||||
xmlschema==2.5.1
|
||||
# via pysaml2
|
||||
yarl==1.9.4
|
||||
yarl==1.18.3
|
||||
# via aiohttp
|
||||
zipp==3.18.1
|
||||
# via
|
||||
|
@ -692,7 +707,7 @@ zipp==3.18.1
|
|||
# importlib-metadata
|
||||
zipstream-ng==1.8.0
|
||||
# via -r base.in
|
||||
zope-interface==6.4.post2
|
||||
zope-interface==7.2
|
||||
# via twisted
|
||||
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
|
|
|
@ -10,15 +10,15 @@ asgiref==3.8.1
|
|||
# via
|
||||
# -c base.txt
|
||||
# django
|
||||
asttokens==2.4.1
|
||||
asttokens==3.0.0
|
||||
# via
|
||||
# snoop
|
||||
# stack-data
|
||||
async-timeout==4.0.3
|
||||
async-timeout==5.0.1
|
||||
# via
|
||||
# -c base.txt
|
||||
# redis
|
||||
attrs==23.2.0
|
||||
attrs==24.3.0
|
||||
# via
|
||||
# -c base.txt
|
||||
# jsonschema
|
||||
|
@ -32,21 +32,21 @@ bandit==1.7.8
|
|||
# via -r dev.in
|
||||
black==23.3.0
|
||||
# via -r dev.in
|
||||
build==1.2.2
|
||||
build==1.2.2.post1
|
||||
# via
|
||||
# -r dev.in
|
||||
# pip-tools
|
||||
certifi==2024.6.2
|
||||
certifi==2024.12.14
|
||||
# via
|
||||
# -c base.txt
|
||||
# requests
|
||||
charset-normalizer==3.3.2
|
||||
charset-normalizer==3.4.1
|
||||
# via
|
||||
# -c base.txt
|
||||
# requests
|
||||
cheap-repr==0.5.2
|
||||
# via snoop
|
||||
click==8.1.7
|
||||
click==8.1.8
|
||||
# via
|
||||
# -c base.txt
|
||||
# black
|
||||
|
@ -98,7 +98,7 @@ httpretty==1.1.4
|
|||
# via -r dev.in
|
||||
icdiff==2.0.7
|
||||
# via pytest-icdiff
|
||||
idna==3.7
|
||||
idna==3.10
|
||||
# via
|
||||
# -c base.txt
|
||||
# requests
|
||||
|
@ -106,15 +106,15 @@ iniconfig==2.0.0
|
|||
# via pytest
|
||||
ipdb==0.13.13
|
||||
# via -r dev.in
|
||||
ipython==8.27.0
|
||||
ipython==8.31.0
|
||||
# via
|
||||
# -r dev.in
|
||||
# ipdb
|
||||
isort==5.13.2
|
||||
# via -r dev.in
|
||||
jedi==0.19.1
|
||||
jedi==0.19.2
|
||||
# via ipython
|
||||
jinja2==3.1.4
|
||||
jinja2==3.1.5
|
||||
# via pytest-html
|
||||
jsonschema==4.17.3
|
||||
# via
|
||||
|
@ -132,7 +132,7 @@ markdown-it-py==3.0.0
|
|||
# via
|
||||
# -c base.txt
|
||||
# rich
|
||||
markupsafe==2.1.5
|
||||
markupsafe==3.0.2
|
||||
# via jinja2
|
||||
matplotlib-inline==0.1.7
|
||||
# via ipython
|
||||
|
@ -174,13 +174,13 @@ pexpect==4.9.0
|
|||
# via ipython
|
||||
pip-tools==7.4.1
|
||||
# via -r dev.in
|
||||
platformdirs==4.3.3
|
||||
platformdirs==4.3.6
|
||||
# via black
|
||||
pluggy==1.5.0
|
||||
# via pytest
|
||||
pprintpp==0.4.0
|
||||
# via pytest-icdiff
|
||||
prompt-toolkit==3.0.46
|
||||
prompt-toolkit==3.0.48
|
||||
# via
|
||||
# -c base.txt
|
||||
# ipython
|
||||
|
@ -196,7 +196,7 @@ pyfakefs==5.4.1
|
|||
# via -r dev.in
|
||||
pyflakes==3.2.0
|
||||
# via flake8
|
||||
pygments==2.18.0
|
||||
pygments==2.19.1
|
||||
# via
|
||||
# -c base.txt
|
||||
# ipython
|
||||
|
@ -204,7 +204,7 @@ pygments==2.18.0
|
|||
# snoop
|
||||
pyinstrument==4.6.2
|
||||
# via -r dev.in
|
||||
pyproject-hooks==1.1.0
|
||||
pyproject-hooks==1.2.0
|
||||
# via
|
||||
# build
|
||||
# pip-tools
|
||||
|
@ -251,11 +251,11 @@ pytest-unordered==0.6.0
|
|||
# via -r dev.in
|
||||
pytest-xdist==3.6.1
|
||||
# via -r dev.in
|
||||
python-dateutil==2.9.0.post0
|
||||
python-dateutil==2.8.2
|
||||
# via
|
||||
# -c base.txt
|
||||
# freezegun
|
||||
pyyaml==6.0.1
|
||||
pyyaml==6.0.2
|
||||
# via
|
||||
# -c base.txt
|
||||
# bandit
|
||||
|
@ -278,10 +278,9 @@ rich==13.7.1
|
|||
# via
|
||||
# -c base.txt
|
||||
# bandit
|
||||
six==1.16.0
|
||||
six==1.17.0
|
||||
# via
|
||||
# -c base.txt
|
||||
# asttokens
|
||||
# python-dateutil
|
||||
# rfc3339-validator
|
||||
# snoop
|
||||
|
@ -289,24 +288,24 @@ snoop==0.4.3
|
|||
# via -r dev.in
|
||||
sortedcontainers==2.4.0
|
||||
# via fakeredis
|
||||
sqlparse==0.5.0
|
||||
sqlparse==0.5.3
|
||||
# via
|
||||
# -c base.txt
|
||||
# django
|
||||
# django-silk
|
||||
stack-data==0.6.3
|
||||
# via ipython
|
||||
stevedore==5.3.0
|
||||
stevedore==5.4.0
|
||||
# via bandit
|
||||
tomli==2.0.1
|
||||
tomli==2.2.1
|
||||
# via django-stubs
|
||||
traitlets==5.14.3
|
||||
# via
|
||||
# ipython
|
||||
# matplotlib-inline
|
||||
types-pytz==2024.2.0.20240913
|
||||
types-pytz==2024.2.0.20241221
|
||||
# via django-stubs
|
||||
types-pyyaml==6.0.12.20240917
|
||||
types-pyyaml==6.0.12.20241230
|
||||
# via django-stubs
|
||||
typing-extensions==4.11.0
|
||||
# via
|
||||
|
@ -315,7 +314,7 @@ typing-extensions==4.11.0
|
|||
# django-stubs-ext
|
||||
# ipython
|
||||
# mypy
|
||||
urllib3==1.26.18
|
||||
urllib3==1.26.20
|
||||
# via
|
||||
# -c base.txt
|
||||
# requests
|
||||
|
@ -326,7 +325,7 @@ wcwidth==0.2.13
|
|||
# via
|
||||
# -c base.txt
|
||||
# prompt-toolkit
|
||||
wheel==0.44.0
|
||||
wheel==0.45.1
|
||||
# via pip-tools
|
||||
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
|
|
|
@ -10,7 +10,7 @@ from cachalot import utils as cachalot_utils
|
|||
from cachalot.settings import cachalot_settings
|
||||
from django_redis import get_redis_connection
|
||||
from loguru import logger
|
||||
from psycopg2.sql import Composed
|
||||
from psycopg.sql import Composed
|
||||
|
||||
|
||||
@contextmanager
|
||||
|
@ -139,7 +139,7 @@ def patch_cachalot_for_baserow():
|
|||
def lower(self):
|
||||
"""
|
||||
Cachalot wants this method to lowercase the queries to check if they are
|
||||
cachable, but the Composed class in psycopg2.sql does not have a lower
|
||||
cachable, but the Composed class in psycopg.sql does not have a lower
|
||||
method, so we add it here to add the support for it.
|
||||
"""
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ from typing import Any, Dict, List, Optional
|
|||
from django.conf import settings
|
||||
from django.db import DEFAULT_DB_ALIAS
|
||||
|
||||
import psycopg2
|
||||
from psycopg2 import sql
|
||||
import psycopg
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.contrib.database.fields.models import (
|
||||
NUMBER_MAX_DECIMAL_PLACES,
|
||||
|
@ -171,7 +171,7 @@ class PostgreSQLDataSyncType(DataSyncType):
|
|||
if baserow_postgresql_connection or data_sync_blacklist:
|
||||
raise SyncError("It's not allowed to connect to this hostname.")
|
||||
try:
|
||||
connection = psycopg2.connect(
|
||||
connection = psycopg.connect(
|
||||
host=instance.postgresql_host,
|
||||
dbname=instance.postgresql_database,
|
||||
user=instance.postgresql_username,
|
||||
|
@ -181,7 +181,7 @@ class PostgreSQLDataSyncType(DataSyncType):
|
|||
)
|
||||
cursor = connection.cursor()
|
||||
yield cursor
|
||||
except psycopg2.Error as e:
|
||||
except psycopg.Error as e:
|
||||
raise SyncError(str(e))
|
||||
finally:
|
||||
if cursor:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.db.transaction import Atomic
|
||||
|
||||
from cachalot.api import cachalot_disabled
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.core.db import IsolationLevel, transaction_atomic
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from django.core.management.color import no_style
|
|||
from django.db import connection
|
||||
from django.db.models import ManyToManyField
|
||||
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.contrib.database.db.schema import safe_django_schema_editor
|
||||
from baserow.contrib.database.fields.models import Field
|
||||
|
|
|
@ -105,7 +105,7 @@ class FieldDependencyHandler:
|
|||
return []
|
||||
|
||||
query_parameters = {
|
||||
"pks": tuple(field_ids),
|
||||
"pks": list(field_ids),
|
||||
"max_depth": settings.MAX_FIELD_REFERENCE_DEPTH,
|
||||
"table_id": table_id,
|
||||
"database_id": database_id_prefilter,
|
||||
|
@ -117,11 +117,11 @@ class FieldDependencyHandler:
|
|||
if associated_relations_changed:
|
||||
associated_relations_changed_query = f"""
|
||||
OR (
|
||||
first.via_id IN %(pks)s
|
||||
OR linkrowfield.link_row_related_field_id IN %(pks)s
|
||||
first.via_id = ANY(%(pks)s)
|
||||
OR linkrowfield.link_row_related_field_id = ANY(%(pks)s)
|
||||
)
|
||||
AND NOT (
|
||||
first.dependant_id IN %(pks)s
|
||||
first.dependant_id = ANY(%(pks)s)
|
||||
)
|
||||
"""
|
||||
else:
|
||||
|
@ -167,7 +167,7 @@ class FieldDependencyHandler:
|
|||
*/
|
||||
CASE
|
||||
WHEN (
|
||||
first.via_id IS NOT NULL
|
||||
first.via_id IS DISTINCT FROM NULL
|
||||
AND (
|
||||
dependant.table_id != %(table_id)s
|
||||
OR dependency.table_id = %(table_id)s
|
||||
|
@ -186,7 +186,7 @@ class FieldDependencyHandler:
|
|||
LEFT OUTER JOIN {field_table} as dependency
|
||||
ON first.dependency_id = dependency.id
|
||||
WHERE
|
||||
first.dependency_id IN %(pks)s
|
||||
first.dependency_id = ANY(%(pks)s)
|
||||
{associated_relations_changed_query}
|
||||
-- LIMITING_FK_EDGES_CLAUSE_1
|
||||
-- DISALLOWED_ANCESTORS_NODES_CLAUSE_1
|
||||
|
|
|
@ -2,7 +2,7 @@ from dataclasses import dataclass
|
|||
|
||||
from django.db import models, transaction
|
||||
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.contrib.database.db.schema import (
|
||||
lenient_schema_editor,
|
||||
|
|
|
@ -309,6 +309,9 @@ class DurationField(models.DurationField):
|
|||
value = duration_value_to_timedelta(value, self.duration_format)
|
||||
return super().get_prep_value(value)
|
||||
|
||||
def to_python(self, value):
|
||||
return super().to_python(value)
|
||||
|
||||
|
||||
class IntegerFieldWithSequence(models.IntegerField):
|
||||
"""
|
||||
|
|
|
@ -22,7 +22,7 @@ from django.db.utils import DatabaseError, DataError, ProgrammingError
|
|||
|
||||
from loguru import logger
|
||||
from opentelemetry import trace
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.contrib.database.db.schema import (
|
||||
lenient_schema_editor,
|
||||
|
|
|
@ -14,6 +14,9 @@ from django.db.models import (
|
|||
)
|
||||
from django.db.models.functions import Cast, Extract, Mod
|
||||
|
||||
import psycopg
|
||||
from psycopg.types.datetime import IntervalLoader
|
||||
|
||||
H_M = "h:mm"
|
||||
H_M_S = "h:mm:ss"
|
||||
H_M_S_S = "h:mm:ss.s"
|
||||
|
@ -702,3 +705,16 @@ def text_value_sql_to_duration(field: "DurationField") -> str:
|
|||
]
|
||||
args = [f"'{arg or 'NULL'}'" for arg in db_function_args]
|
||||
return f"br_text_to_interval(p_in, {','.join(args)});"
|
||||
|
||||
|
||||
class BaserowIntervalLoader(IntervalLoader):
|
||||
"""
|
||||
We're not doing anything special here, but if we don't register this
|
||||
adapter tests will fail when parsing negative intervals.
|
||||
"""
|
||||
|
||||
def load(self, data):
|
||||
return super().load(data)
|
||||
|
||||
|
||||
psycopg.adapters.register_loader("interval", BaserowIntervalLoader)
|
||||
|
|
|
@ -22,7 +22,7 @@ class BinaryOpExpr(Transform):
|
|||
|
||||
|
||||
class IsNullExpr(Transform):
|
||||
template = "(%(expressions)s) IS NULL"
|
||||
template = "(%(expressions)s) IS NOT DISTINCT FROM NULL"
|
||||
arity = 1
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from django.db import connection, migrations
|
||||
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.contrib.database.fields.models import (
|
||||
CreatedOnField,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from django.db import connection, migrations
|
||||
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
|
||||
def remove_duplicates(model, view):
|
||||
|
|
|
@ -13,7 +13,7 @@ from django.utils.encoding import force_str
|
|||
|
||||
from loguru import logger
|
||||
from opentelemetry import trace
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
from redis.exceptions import LockNotOwnedError
|
||||
|
||||
from baserow.contrib.database.db.schema import safe_django_schema_editor
|
||||
|
|
|
@ -11,7 +11,7 @@ from django.utils import translation
|
|||
from django.utils.translation import gettext as _
|
||||
|
||||
from opentelemetry import trace
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.contrib.database.db.schema import safe_django_schema_editor
|
||||
from baserow.contrib.database.fields.constants import RESERVED_BASEROW_FIELD_NAMES
|
||||
|
|
|
@ -21,7 +21,7 @@ from django.db.models.query import QuerySet
|
|||
import jwt
|
||||
from loguru import logger
|
||||
from opentelemetry import trace
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
from redis.exceptions import LockNotOwnedError
|
||||
|
||||
from baserow.contrib.database.api.utils import get_include_exclude_field_ids
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import connection, models
|
||||
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from baserow.core.mixins import (
|
||||
CreatedAndUpdatedOnMixin,
|
||||
|
|
|
@ -26,7 +26,7 @@ from django.db.models.sql.query import LOOKUP_SEP
|
|||
from django.db.transaction import Atomic, get_connection
|
||||
|
||||
from loguru import logger
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
from .utils import find_intermediate_order
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from datetime import datetime, timezone
|
|||
from pathlib import Path
|
||||
from typing import List, Optional
|
||||
|
||||
import psycopg2
|
||||
import psycopg
|
||||
|
||||
from baserow.contrib.database.fields.models import (
|
||||
LinkRowField,
|
||||
|
@ -156,7 +156,7 @@ class BaserowBackupRunner:
|
|||
return ["pg_restore"] + self._get_postgres_tool_args() + extra_command
|
||||
|
||||
def _build_connection(self):
|
||||
return psycopg2.connect(
|
||||
return psycopg.connect(
|
||||
host=self.host,
|
||||
port=self.port,
|
||||
database=self.database,
|
||||
|
|
|
@ -10,7 +10,7 @@ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExport
|
|||
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
|
||||
from opentelemetry.instrumentation.celery import CeleryInstrumentor
|
||||
from opentelemetry.instrumentation.django import DjangoInstrumentor
|
||||
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor
|
||||
from opentelemetry.instrumentation.psycopg import PsycopgInstrumentor
|
||||
from opentelemetry.instrumentation.redis import RedisInstrumentor
|
||||
from opentelemetry.instrumentation.requests import RequestsInstrumentor
|
||||
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
|
||||
|
@ -131,7 +131,7 @@ def _setup_log_exporting(logger):
|
|||
|
||||
def _setup_standard_backend_instrumentation():
|
||||
BotocoreInstrumentor().instrument()
|
||||
Psycopg2Instrumentor().instrument()
|
||||
PsycopgInstrumentor().instrument()
|
||||
RedisInstrumentor().instrument()
|
||||
RequestsInstrumentor().instrument()
|
||||
CeleryInstrumentor().instrument()
|
||||
|
|
|
@ -13,7 +13,7 @@ from django.contrib.auth.models import AbstractUser
|
|||
from django.db import connection
|
||||
from django.utils.dateparse import parse_date, parse_datetime
|
||||
|
||||
import psycopg2
|
||||
import psycopg
|
||||
from freezegun import freeze_time
|
||||
from pytest_unordered import unordered
|
||||
|
||||
|
@ -470,9 +470,9 @@ def assert_undo_redo_actions_fails_with_error(
|
|||
@contextmanager
|
||||
def independent_test_db_connection():
|
||||
d = connection.settings_dict
|
||||
conn = psycopg2.connect(
|
||||
conn = psycopg.connect(
|
||||
host=d["HOST"],
|
||||
database=d["NAME"],
|
||||
dbname=d["NAME"],
|
||||
user=d["USER"],
|
||||
password=d["PASSWORD"],
|
||||
port=d["PORT"],
|
||||
|
|
|
@ -467,10 +467,7 @@ def test_convert_duration_field_to_text_to_duration_field(
|
|||
|
||||
row_1 = model.objects.first()
|
||||
updated_value = getattr(row_1, f"field_{field.id}")
|
||||
# compare timedelta values
|
||||
# assert updated_value == dest_value, ( # inital_value, (
|
||||
# input_format, input_value, dest_format, dest_value, updated_value,
|
||||
# )
|
||||
|
||||
if updated_value is not None:
|
||||
formatted = format_duration_value(updated_value, dest_format)
|
||||
else:
|
||||
|
|
|
@ -71,7 +71,7 @@ def test_can_backup_and_restore_baserow_reverting_changes(data_fixture, environ)
|
|||
|
||||
|
||||
@patch("tempfile.TemporaryDirectory")
|
||||
@patch("psycopg2.connect")
|
||||
@patch("psycopg.connect")
|
||||
@patch("subprocess.check_output")
|
||||
def test_backup_baserow_dumps_database_in_batches(
|
||||
mock_check_output, mock_connect, mock_tempfile, fs, environ
|
||||
|
@ -141,7 +141,7 @@ def test_backup_baserow_dumps_database_in_batches(
|
|||
|
||||
|
||||
@patch("tempfile.TemporaryDirectory")
|
||||
@patch("psycopg2.connect")
|
||||
@patch("psycopg.connect")
|
||||
@patch("subprocess.check_output")
|
||||
def test_can_change_num_jobs_and_insert_extra_args_for_baserow_backup(
|
||||
mock_check_output, mock_connect, mock_tempfile, fs, environ
|
||||
|
@ -226,7 +226,7 @@ def test_can_change_num_jobs_and_insert_extra_args_for_baserow_backup(
|
|||
|
||||
|
||||
@patch("tempfile.TemporaryDirectory")
|
||||
@patch("psycopg2.connect")
|
||||
@patch("psycopg.connect")
|
||||
@patch("subprocess.check_output")
|
||||
def test_backup_baserow_table_batches_includes_all_tables_when_final_batch_small(
|
||||
mock_check_output, mock_connect, mock_tempfile, fs, environ
|
||||
|
@ -285,7 +285,7 @@ def test_backup_baserow_table_batches_includes_all_tables_when_final_batch_small
|
|||
|
||||
|
||||
@patch("tempfile.TemporaryDirectory")
|
||||
@patch("psycopg2.connect")
|
||||
@patch("psycopg.connect")
|
||||
@patch("subprocess.check_output")
|
||||
def test_backup_baserow_includes_all_tables_when_batch_size_matches_num_tables(
|
||||
mock_check_output, mock_connect, mock_tempfile, fs, environ
|
||||
|
@ -336,7 +336,7 @@ def test_backup_baserow_includes_all_tables_when_batch_size_matches_num_tables(
|
|||
|
||||
|
||||
@patch("tempfile.TemporaryDirectory")
|
||||
@patch("psycopg2.connect")
|
||||
@patch("psycopg.connect")
|
||||
@patch("subprocess.check_output")
|
||||
def test_backup_baserow_does_no_table_batches_when_no_user_tables_found(
|
||||
mock_check_output, mock_connect, mock_tempfile, fs, environ
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "refactor",
|
||||
"message": "Upgrade to psycopg3",
|
||||
"issue_number": 1689,
|
||||
"bullet_points": [],
|
||||
"created_at": "2025-01-08"
|
||||
}
|
|
@ -58,7 +58,7 @@ automatic style fixers to make your life as easy as possible.
|
|||
CREATE USER baserow WITH ENCRYPTED PASSWORD 'baserow';
|
||||
ALTER USER baserow CREATEDB;
|
||||
```
|
||||
4. You might also have to `pip install psycopg2-binary` or
|
||||
4. You might also have to `pip install "psycopg[binary]"` or
|
||||
`sudo apt install postgresql-devel`
|
||||
1. Now you should be able to run the backend python tests, try
|
||||
run `backend/tests/baserow/core/test_core_models.py` for instance.
|
||||
|
|
|
@ -49,7 +49,7 @@ automatic style fixers to make your life as easy as possible.
|
|||
CREATE USER baserow WITH ENCRYPTED PASSWORD 'baserow';
|
||||
ALTER USER baserow CREATEDB;
|
||||
```
|
||||
4. You might also have to `pip install psycopg2-binary` or
|
||||
4. You might also have to `pip install "psycopg[binary]"` or
|
||||
`sudo apt install libpq-dev`
|
||||
1. Now you should be able to run the backend python tests from the testing menu, try
|
||||
run `backend/tests/baserow/core/test_core_models.py` for instance.
|
||||
|
|
|
@ -170,6 +170,7 @@ deprecated==1.2.14
|
|||
# via
|
||||
# opentelemetry-api
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
# opentelemetry-semantic-conventions
|
||||
distro==1.9.0
|
||||
# via
|
||||
# anthropic
|
||||
|
@ -456,7 +457,7 @@ openapi-spec-validator==0.5.6
|
|||
# via -r dev.in
|
||||
openpyxl==3.1.5
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-api==1.24.0
|
||||
opentelemetry-api==1.29.0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
|
@ -469,17 +470,18 @@ opentelemetry-api==1.24.0
|
|||
# opentelemetry-instrumentation-django
|
||||
# opentelemetry-instrumentation-grpc
|
||||
# opentelemetry-instrumentation-logging
|
||||
# opentelemetry-instrumentation-psycopg2
|
||||
# opentelemetry-instrumentation-psycopg
|
||||
# opentelemetry-instrumentation-redis
|
||||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
# opentelemetry-propagator-aws-xray
|
||||
# opentelemetry-sdk
|
||||
opentelemetry-exporter-otlp-proto-common==1.24.0
|
||||
# opentelemetry-semantic-conventions
|
||||
opentelemetry-exporter-otlp-proto-common==1.29.0
|
||||
# via opentelemetry-exporter-otlp-proto-http
|
||||
opentelemetry-exporter-otlp-proto-http==1.24.0
|
||||
opentelemetry-exporter-otlp-proto-http==1.29.0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation==0.45b0
|
||||
opentelemetry-instrumentation==0.50b0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-instrumentation-aiohttp-client
|
||||
|
@ -490,53 +492,53 @@ opentelemetry-instrumentation==0.45b0
|
|||
# opentelemetry-instrumentation-django
|
||||
# opentelemetry-instrumentation-grpc
|
||||
# opentelemetry-instrumentation-logging
|
||||
# opentelemetry-instrumentation-psycopg2
|
||||
# opentelemetry-instrumentation-psycopg
|
||||
# opentelemetry-instrumentation-redis
|
||||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
opentelemetry-instrumentation-aiohttp-client==0.45b0
|
||||
opentelemetry-instrumentation-aiohttp-client==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-asgi==0.45b0
|
||||
opentelemetry-instrumentation-asgi==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-botocore==0.45b0
|
||||
opentelemetry-instrumentation-botocore==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-celery==0.45b0
|
||||
opentelemetry-instrumentation-celery==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-dbapi==0.45b0
|
||||
opentelemetry-instrumentation-dbapi==0.50b0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-instrumentation-psycopg2
|
||||
opentelemetry-instrumentation-django==0.45b0
|
||||
# opentelemetry-instrumentation-psycopg
|
||||
opentelemetry-instrumentation-django==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-grpc==0.45b0
|
||||
opentelemetry-instrumentation-grpc==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-logging==0.45b0
|
||||
opentelemetry-instrumentation-logging==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-psycopg2==0.45b0
|
||||
opentelemetry-instrumentation-psycopg==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-redis==0.45b0
|
||||
opentelemetry-instrumentation-redis==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-requests==0.45b0
|
||||
opentelemetry-instrumentation-requests==0.50b0
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
opentelemetry-instrumentation-wsgi==0.45b0
|
||||
opentelemetry-instrumentation-wsgi==0.50b0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-instrumentation-django
|
||||
opentelemetry-propagator-aws-xray==1.0.1
|
||||
# via opentelemetry-instrumentation-botocore
|
||||
opentelemetry-proto==1.24.0
|
||||
opentelemetry-proto==1.29.0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-exporter-otlp-proto-common
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
opentelemetry-sdk==1.24.0
|
||||
opentelemetry-sdk==1.29.0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-exporter-otlp-proto-http
|
||||
# opentelemetry-instrumentation-grpc
|
||||
opentelemetry-semantic-conventions==0.45b0
|
||||
opentelemetry-semantic-conventions==0.50b0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-instrumentation
|
||||
# opentelemetry-instrumentation-aiohttp-client
|
||||
# opentelemetry-instrumentation-asgi
|
||||
# opentelemetry-instrumentation-botocore
|
||||
|
@ -548,7 +550,7 @@ opentelemetry-semantic-conventions==0.45b0
|
|||
# opentelemetry-instrumentation-requests
|
||||
# opentelemetry-instrumentation-wsgi
|
||||
# opentelemetry-sdk
|
||||
opentelemetry-util-http==0.45b0
|
||||
opentelemetry-util-http==0.50b0
|
||||
# via
|
||||
# -r /baserow/backend/requirements/base.in
|
||||
# opentelemetry-instrumentation-aiohttp-client
|
||||
|
@ -566,6 +568,7 @@ packaging==23.2
|
|||
# huggingface-hub
|
||||
# langchain-core
|
||||
# marshmallow
|
||||
# opentelemetry-instrumentation
|
||||
# pytest
|
||||
parso==0.8.4
|
||||
# via jedi
|
||||
|
@ -599,7 +602,7 @@ prosemirror @ https://github.com/fellowapp/prosemirror-py/archive/refs/tags/v0.3
|
|||
# via -r /baserow/backend/requirements/base.in
|
||||
proto-plus==1.24.0
|
||||
# via google-api-core
|
||||
protobuf==4.25.4
|
||||
protobuf==5.29.2
|
||||
# via
|
||||
# google-api-core
|
||||
# googleapis-common-protos
|
||||
|
@ -607,7 +610,9 @@ protobuf==4.25.4
|
|||
# proto-plus
|
||||
psutil==5.9.8
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
psycopg2==2.9.9
|
||||
psycopg==3.2.3
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
psycopg-binary==3.2.3
|
||||
# via -r /baserow/backend/requirements/base.in
|
||||
ptyprocess==0.7.0
|
||||
# via pexpect
|
||||
|
@ -867,6 +872,7 @@ typing-extensions==4.11.0
|
|||
# openai
|
||||
# opentelemetry-sdk
|
||||
# prosemirror
|
||||
# psycopg
|
||||
# pydantic
|
||||
# pydantic-core
|
||||
# sqlalchemy
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from django.db import connection, migrations
|
||||
|
||||
from psycopg2 import sql
|
||||
from psycopg import sql
|
||||
|
||||
|
||||
def remove_duplicates(model, view):
|
||||
|
|
Loading…
Add table
Reference in a new issue