Migrating to psycopg3
This will need coordination with other MR migrating other part of swh to psycopg3, more notably, swh-core. Updates various imports and names. Adjusts syntax query and parameter to what psycopg3 expect. The `origins_are_blocked` of the Blocking proxy class needed significant rework for equivalent features. Dropped timezone related work around that existed for psycopg2 < 2.9.0 Adjust the way we retrieve the connection information. This update as the same caveas as for swh-core and needs some double check. Use the dedicated `psycopg_pool` package for connection pull. Adds a small `execute_values_generator` helper to match existing code expectation better (reducing the complexity of this diff). Drops a call to the deprecated and noop `app.setup_psycopg_errorhandlers` Add more type to help mypy and catch errors.
Showing
- requirements-swh.txt 1 addition, 1 deletionrequirements-swh.txt
- requirements.txt 2 additions, 1 deletionrequirements.txt
- swh/storage/backfill.py 2 additions, 2 deletionsswh/storage/backfill.py
- swh/storage/cassandra/cql.py 2 additions, 2 deletionsswh/storage/cassandra/cql.py
- swh/storage/cassandra/schema.py 1 addition, 0 deletionsswh/storage/cassandra/schema.py
- swh/storage/migrate_extrinsic_metadata.py 2 additions, 2 deletionsswh/storage/migrate_extrinsic_metadata.py
- swh/storage/postgresql/db.py 96 additions, 90 deletionsswh/storage/postgresql/db.py
- swh/storage/postgresql/storage.py 34 additions, 36 deletionsswh/storage/postgresql/storage.py
- swh/storage/proxies/blocking/__init__.py 5 additions, 3 deletionsswh/storage/proxies/blocking/__init__.py
- swh/storage/proxies/blocking/cli.py 1 addition, 1 deletionswh/storage/proxies/blocking/cli.py
- swh/storage/proxies/blocking/db.py 68 additions, 62 deletionsswh/storage/proxies/blocking/db.py
- swh/storage/proxies/masking/__init__.py 5 additions, 3 deletionsswh/storage/proxies/masking/__init__.py
- swh/storage/proxies/masking/cli.py 1 addition, 1 deletionswh/storage/proxies/masking/cli.py
- swh/storage/proxies/masking/db.py 69 additions, 57 deletionsswh/storage/proxies/masking/db.py
- swh/storage/tests/blocking/test_db.py 1 addition, 1 deletionswh/storage/tests/blocking/test_db.py
- swh/storage/tests/blocking/test_proxy.py 20 additions, 0 deletionsswh/storage/tests/blocking/test_proxy.py
- swh/storage/tests/masking/test_db.py 1 addition, 1 deletionswh/storage/tests/masking/test_db.py
- swh/storage/tests/storage_tests.py 4 additions, 4 deletionsswh/storage/tests/storage_tests.py
- swh/storage/tests/test_api_client.py 3 additions, 3 deletionsswh/storage/tests/test_api_client.py
- swh/storage/tests/test_cassandra.py 1 addition, 1 deletionswh/storage/tests/test_cassandra.py
Loading
Please register or sign in to comment