wcp-library 1.0.7__tar.gz → 1.0.8__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.
- {wcp_library-1.0.7 → wcp_library-1.0.8}/PKG-INFO +1 -1
- {wcp_library-1.0.7 → wcp_library-1.0.8}/pyproject.toml +1 -1
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_sql/oracle.py +29 -34
- {wcp_library-1.0.7 → wcp_library-1.0.8}/README.md +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/__init__.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_credentials/__init__.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_credentials/api.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_credentials/oracle.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_credentials/postgres.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_sql/__init__.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/async_sql/postgres.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/credentials/__init__.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/credentials/api.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/credentials/oracle.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/credentials/postgres.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/emailing.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/informatica.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/logging.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/sql/__init__.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/sql/oracle.py +0 -0
- {wcp_library-1.0.7 → wcp_library-1.0.8}/wcp_library/sql/postgres.py +0 -0
@@ -112,11 +112,10 @@ class AsyncOracleConnection(object):
|
|
112
112
|
:return: None
|
113
113
|
"""
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
await self._session_pool.release(connection)
|
115
|
+
async with self._session_pool.acquire() as connection:
|
116
|
+
with connection.cursor() as cursor:
|
117
|
+
await cursor.execute(query)
|
118
|
+
await connection.commit()
|
120
119
|
|
121
120
|
@retry
|
122
121
|
async def safe_execute(self, query: str, packed_values: dict) -> None:
|
@@ -128,11 +127,10 @@ class AsyncOracleConnection(object):
|
|
128
127
|
:return: None
|
129
128
|
"""
|
130
129
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
await self._session_pool.release(connection)
|
130
|
+
async with self._session_pool.acquire() as connection:
|
131
|
+
with connection.cursor() as cursor:
|
132
|
+
await cursor.execute(query, packed_values)
|
133
|
+
await connection.commit()
|
136
134
|
|
137
135
|
@retry
|
138
136
|
async def execute_multiple(self, queries: list[list[str, dict]]) -> None:
|
@@ -143,17 +141,16 @@ class AsyncOracleConnection(object):
|
|
143
141
|
:return: None
|
144
142
|
"""
|
145
143
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
await self._session_pool.release(connection)
|
144
|
+
async with self._session_pool.acquire() as connection:
|
145
|
+
with connection.cursor() as cursor:
|
146
|
+
for item in queries:
|
147
|
+
query = item[0]
|
148
|
+
packed_values = item[1]
|
149
|
+
if packed_values:
|
150
|
+
await cursor.execute(query, packed_values)
|
151
|
+
else:
|
152
|
+
await cursor.execute(query)
|
153
|
+
await connection.commit()
|
157
154
|
|
158
155
|
@retry
|
159
156
|
async def execute_many(self, query: str, dictionary: list[dict]) -> None:
|
@@ -165,11 +162,10 @@ class AsyncOracleConnection(object):
|
|
165
162
|
:return: None
|
166
163
|
"""
|
167
164
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
await self._session_pool.release(connection)
|
165
|
+
async with self._session_pool.acquire() as connection:
|
166
|
+
with connection.cursor() as cursor:
|
167
|
+
await cursor.executemany(query, dictionary)
|
168
|
+
await connection.commit()
|
173
169
|
|
174
170
|
@retry
|
175
171
|
async def fetch_data(self, query: str, packed_data=None):
|
@@ -181,14 +177,13 @@ class AsyncOracleConnection(object):
|
|
181
177
|
:return: rows
|
182
178
|
"""
|
183
179
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
await self._session_pool.release(connection)
|
180
|
+
async with self._session_pool.acquire() as connection:
|
181
|
+
with connection.cursor() as cursor:
|
182
|
+
if packed_data:
|
183
|
+
await cursor.execute(query, packed_data)
|
184
|
+
else:
|
185
|
+
await cursor.execute(query)
|
186
|
+
rows = cursor.fetchall()
|
192
187
|
return rows
|
193
188
|
|
194
189
|
@retry
|
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
|