Skip to content

Commit

Permalink
little changes client.py and tap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
RobyBen committed Nov 24, 2024
1 parent f811255 commit 802bda8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tap_postgres/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,19 +465,14 @@ def logical_replication_connection(self):
connection_string = (
f"dbname={self.config['database']} "
f"user={self.config['user']} "
f"password{self.config['password']} "
f"password={self.config['password']} "
f"host={self.config['host']} "
f"port={self.config['port']}"
"replication=database"
)
return psycopg2.connect(
connection_string,
# add slot name to application_name
application_name=(
f"tap_postgres_{self.config.get(
'replication_slot_name', "f"'tappostgres')}"
),
connection_factory=extras.LogicalReplicationConnection,
application_name="tap_postgres",
connection_factory=extras.LogicalReplicationConnection
)

# TODO: Make this change upstream in the SDK?
Expand Down
9 changes: 9 additions & 0 deletions tap_postgres/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,16 @@ def __init__(
"Name of the replication slot to use for logical replication. "
"Must be unique for parallel extractions. "
"Only applicable when replication_method is LOG_BASED."
"- Contain only letters, numbers, and underscores. "
"- Be less than or equal to 63 characters. "
"- Not start with 'pg_'."
),
validation={
"pattern": "^(?!pg_)[A-Za-z0-9_]{1,63}$",
"errorMessage": "Replication slot name must be alphanumeric, "
"may include underscores, must not exceed 63 characters, "
"and cannot start with 'pg_'."
},
), # New Property
th.Property(
"host",
Expand Down

0 comments on commit 802bda8

Please sign in to comment.