Skip to content

Commit 3a919f9

Browse files
refactor: Switch default driver to psycopg3
1 parent d96acf9 commit 3a919f9

File tree

7 files changed

+176
-69
lines changed

7 files changed

+176
-69
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This target is tested with all actively supported [Python](https://devguide.pyth
3232
| password | False | None | Password used to authenticate. Note if sqlalchemy_url is set this will be ignored. |
3333
| database | False | None | Database name. Note if sqlalchemy_url is set this will be ignored. |
3434
| sqlalchemy_url | False | None | SQLAlchemy connection string. This will override using host, user, password, port, dialect, and all ssl settings. Note that you must escape password special characters properly. See https://docs.sqlalchemy.org/en/20/core/engines.html#escaping-special-characters-such-as-signs-in-passwords |
35-
| dialect+driver | False | postgresql+psycopg2 | Dialect+driver see https://docs.sqlalchemy.org/en/20/core/engines.html. Generally just leave this alone. Note if sqlalchemy_url is set this will be ignored. |
35+
| dialect+driver | False | postgresql+psycopg | Dialect+driver see https://docs.sqlalchemy.org/en/20/core/engines.html. Generally just leave this alone. Note if sqlalchemy_url is set this will be ignored. |
3636
| default_target_schema | False | melty | Postgres schema to send data to, example: tap-clickup |
3737
| activate_version | False | 1 | If set to false, the tap will ignore activate version messages. If set to true, add_record_metadata must be set to true as well. |
3838
| hard_delete | False | 0 | When activate version is sent from a tap this specefies if we should delete the records that don't match, or mark them with a date in the `_sdc_deleted_at` column. This config option is ignored if `activate_version` is set to false. |

poetry.lock

Lines changed: 168 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ packages = [
3434
[tool.poetry.dependencies]
3535
python = ">=3.9"
3636
faker = {version = "~=30.0", optional = true}
37+
psycopg = {extras = ["binary"], version = "3.2.3"}
3738
psycopg2-binary = "2.9.10"
3839
sqlalchemy = "~=2.0"
3940
sshtunnel = "0.4.0"

target_postgres/target.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __init__(
150150
th.Property(
151151
"dialect+driver",
152152
th.StringType,
153-
default="postgresql+psycopg2",
153+
default="postgresql+psycopg",
154154
description=(
155155
"Dialect+driver see "
156156
+ "https://docs.sqlalchemy.org/en/20/core/engines.html. "

target_postgres/tests/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
def postgres_config():
1010
return {
11-
"dialect+driver": "postgresql+psycopg2",
11+
"dialect+driver": "postgresql+psycopg",
1212
"host": "localhost",
1313
"user": "postgres",
1414
"password": "postgres",
@@ -29,7 +29,7 @@ def postgres_config():
2929

3030
def postgres_config_no_ssl():
3131
return {
32-
"dialect+driver": "postgresql+psycopg2",
32+
"dialect+driver": "postgresql+psycopg",
3333
"host": "localhost",
3434
"user": "postgres",
3535
"password": "postgres",

target_postgres/tests/test_target_postgres.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def test_sqlalchemy_url_config(postgres_config_no_ssl):
167167
def test_port_default_config():
168168
"""Test that the default config is passed into the engine when the config doesn't provide it"""
169169
config = {
170-
"dialect+driver": "postgresql+psycopg2",
170+
"dialect+driver": "postgresql+psycopg",
171171
"host": "localhost",
172172
"user": "postgres",
173173
"password": "postgres",
@@ -191,7 +191,7 @@ def test_port_default_config():
191191
def test_port_config():
192192
"""Test that the port config works"""
193193
config = {
194-
"dialect+driver": "postgresql+psycopg2",
194+
"dialect+driver": "postgresql+psycopg",
195195
"host": "localhost",
196196
"user": "postgres",
197197
"password": "postgres",

target_postgres/tests/test_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def connector():
1111
"""Create a PostgresConnector instance."""
1212
return PostgresConnector(
1313
config={
14-
"dialect+driver": "postgresql+psycopg2",
14+
"dialect+driver": "postgresql+psycopg",
1515
"host": "localhost",
1616
"port": "5432",
1717
"user": "postgres",

0 commit comments

Comments
 (0)