pgbelt 0.7.8__tar.gz → 0.7.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pgbelt-0.7.8 → pgbelt-0.7.9}/PKG-INFO +1 -1
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/util/postgres.py +12 -7
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pyproject.toml +1 -1
- {pgbelt-0.7.8 → pgbelt-0.7.9}/LICENSE +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/README.md +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/__init__.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/__init__.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/convenience.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/helpers.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/login.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/preflight.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/schema.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/setup.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/status.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/sync.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/cmd/teardown.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/config/__init__.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/config/config.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/config/models.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/config/remote.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/main.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/util/__init__.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/util/asyncfuncs.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/util/dump.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/util/logs.py +0 -0
- {pgbelt-0.7.8 → pgbelt-0.7.9}/pgbelt/util/pglogical.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pgbelt
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.9
|
|
4
4
|
Summary: A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
|
|
5
5
|
Author: Varjitt Jeeva
|
|
6
6
|
Author-email: varjitt.jeeva@autodesk.com
|
|
@@ -106,17 +106,22 @@ async def compare_data(
|
|
|
106
106
|
full_table_name = f'{schema}."{table}"'
|
|
107
107
|
|
|
108
108
|
logger.debug(f"Validating table {full_table_name}...")
|
|
109
|
-
order_by_pkeys = ",".join(pkeys_dict[table])
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
# Have to wrap each pkey in double quotes due to capitalization issues.
|
|
111
|
+
order_by_pkeys = ""
|
|
112
|
+
for pkey in pkeys_dict[table]:
|
|
113
|
+
order_by_pkeys += f'"{pkey}", '
|
|
114
|
+
order_by_pkeys = order_by_pkeys[:-2]
|
|
115
|
+
|
|
116
|
+
filled_query = query.format(
|
|
117
|
+
table=full_table_name, order_by_pkeys=order_by_pkeys
|
|
113
118
|
)
|
|
114
119
|
|
|
120
|
+
src_rows = await src_pool.fetch(filled_query)
|
|
121
|
+
|
|
115
122
|
# There is a chance tables are empty...
|
|
116
123
|
if len(src_rows) == 0:
|
|
117
|
-
dst_rows = await dst_pool.fetch(
|
|
118
|
-
query.format(table=full_table_name, order_by_pkeys=order_by_pkeys)
|
|
119
|
-
)
|
|
124
|
+
dst_rows = await dst_pool.fetch(filled_query)
|
|
120
125
|
if len(dst_rows) != 0:
|
|
121
126
|
raise AssertionError(
|
|
122
127
|
f"Table {full_table_name} has 0 rows in source but nonzero rows in target... Big problem. Please investigate."
|
|
@@ -144,7 +149,7 @@ async def compare_data(
|
|
|
144
149
|
dst_query = f"SELECT * FROM {full_table_name} WHERE "
|
|
145
150
|
|
|
146
151
|
for k, v in pkey_vals_dict.items():
|
|
147
|
-
dst_query = dst_query + f"{k} IN ({v}) AND
|
|
152
|
+
dst_query = dst_query + f'"{k}" IN ({v}) AND '
|
|
148
153
|
|
|
149
154
|
# SELECT * FROM <table> WHERE <pkey1> IN (1,2,3,4,5,6...) AND <pkey2> IN ('a','b','c',...);
|
|
150
155
|
comparison_query = dst_query[:-5] + f" ORDER BY {order_by_pkeys};"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pgbelt"
|
|
3
|
-
version = "0.7.
|
|
3
|
+
version = "0.7.9"
|
|
4
4
|
description = "A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication."
|
|
5
5
|
authors = ["Varjitt Jeeva <varjitt.jeeva@autodesk.com>"]
|
|
6
6
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|