pgconnect 0.3.2__tar.gz → 0.3.4__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.
- {pgconnect-0.3.2/src/pgconnect.egg-info → pgconnect-0.3.4}/PKG-INFO +1 -1
- {pgconnect-0.3.2 → pgconnect-0.3.4}/pyproject.toml +1 -1
- {pgconnect-0.3.2 → pgconnect-0.3.4}/setup.py +1 -1
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/Table.py +4 -4
- {pgconnect-0.3.2 → pgconnect-0.3.4/src/pgconnect.egg-info}/PKG-INFO +1 -1
- {pgconnect-0.3.2 → pgconnect-0.3.4}/LICENSE +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/README.md +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/setup.cfg +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/Column.py +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/Connection.py +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/DataType.py +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/Filters.py +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/__init__.py +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect/examples.py +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect.egg-info/SOURCES.txt +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect.egg-info/dependency_links.txt +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect.egg-info/requires.txt +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/src/pgconnect.egg-info/top_level.txt +0 -0
- {pgconnect-0.3.2 → pgconnect-0.3.4}/tests/test_pgconnect.py +0 -0
|
@@ -86,7 +86,6 @@ class Table:
|
|
|
86
86
|
"""
|
|
87
87
|
try:
|
|
88
88
|
if not self.indexes:
|
|
89
|
-
print(f"No indexes defined for table {self.name}. Skipping index schema check.")
|
|
90
89
|
return True
|
|
91
90
|
connection = await self._get_connection()
|
|
92
91
|
# if connection is busy wait 1 second and try again
|
|
@@ -94,7 +93,7 @@ class Table:
|
|
|
94
93
|
# make sure nothing more than in that index is defined
|
|
95
94
|
for key in index:
|
|
96
95
|
if key not in ["name", "columns", "unique"]:
|
|
97
|
-
print(f"Index {index['name']} has invalid key {key}. Skipping index schema check
|
|
96
|
+
print(f"Index {index['name']} has invalid key {key}. Skipping index schema check.\nExpected keys are: ['name', 'columns', 'unique']")
|
|
98
97
|
return False
|
|
99
98
|
return True
|
|
100
99
|
except Exception as e:
|
|
@@ -120,12 +119,13 @@ class Table:
|
|
|
120
119
|
WHERE tablename = '{self.name}';
|
|
121
120
|
"""
|
|
122
121
|
existing_indexes = await connection.fetch(existing_indexes_query, timeout=self.timeout)
|
|
123
|
-
print(f"Existing indexes for {self.name}: {existing_indexes}")
|
|
124
122
|
# drop indexes that are not defined in the table
|
|
125
123
|
for index in existing_indexes:
|
|
126
124
|
index_name = index['indexname']
|
|
127
125
|
if index_name == f"{self.name}_pkey":
|
|
128
|
-
|
|
126
|
+
continue
|
|
127
|
+
all_columns_indexes_possibles = [f"{self.name}_{column.name}_key" for column in self.columns]
|
|
128
|
+
if index_name in all_columns_indexes_possibles:
|
|
129
129
|
continue
|
|
130
130
|
if self.indexes:
|
|
131
131
|
if not any(index_name == idx.get("name", None) for idx in self.indexes):
|
|
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
|