lbxtoolkit 2.4.1__tar.gz → 2.4.3__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.
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/PKG-INFO +1 -1
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/postgresql.py +45 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/pyproject.toml +1 -1
- lbxtoolkit-2.4.1/lbxtoolkit/lbxtoolkit.zip +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/README.md +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/__init__.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/api_rest.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/auth_entra_id.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/chrome_session.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/config_manager.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/lbx_logger.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/locators.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/misc.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/service.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/service_windows.py +0 -0
- {lbxtoolkit-2.4.1 → lbxtoolkit-2.4.3}/lbxtoolkit/webdrive_handler.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lbxtoolkit
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.3
|
|
4
4
|
Summary: Caixa ferramentas da LBX para automações de processos (RPA), integrações, utilitários Windows e componentes reutilizáveis.
|
|
5
5
|
Author: Cristiano P. Ferrari
|
|
6
6
|
Author-email: cristiano.ferrari@lbx.com.br
|
|
@@ -290,3 +290,48 @@ conexao.close()
|
|
|
290
290
|
raise
|
|
291
291
|
#
|
|
292
292
|
#
|
|
293
|
+
def db_execute(self, Query, Fetch=False): # Executa comandos SQL complexos, inclusive DML com CTE
|
|
294
|
+
"""
|
|
295
|
+
Executa comandos SQL de manipulação de dados que não se enquadram nos métodos
|
|
296
|
+
db_select(), db_update() ou db_insert_df().
|
|
297
|
+
|
|
298
|
+
Use este método para comandos DML complexos, especialmente UPDATE/INSERT/DELETE
|
|
299
|
+
com CTE (WITH), subqueries ou RETURNING.
|
|
300
|
+
|
|
301
|
+
Por segurança, comandos de DDL e execução dinâmica não são permitidos.
|
|
302
|
+
|
|
303
|
+
Parâmetros:
|
|
304
|
+
- Query: Comando SQL a executar.
|
|
305
|
+
- Fetch: Quando True, retorna os dados do cursor e os nomes das colunas
|
|
306
|
+
se o comando produzir resultset (ex: RETURNING).
|
|
307
|
+
|
|
308
|
+
Retorno:
|
|
309
|
+
- Se Fetch=True e houver resultset: (Dados, Colunas)
|
|
310
|
+
- Caso contrário: quantidade de linhas afetadas
|
|
311
|
+
"""
|
|
312
|
+
UpdRows = 0
|
|
313
|
+
BlackList = ['CREATE ', 'DROP ', 'ALTER ', 'TRUNCATE ', 'REPLACE ', 'CALL ', 'EXECUTE ']
|
|
314
|
+
|
|
315
|
+
if any(element in Query.upper() for element in BlackList):
|
|
316
|
+
BlackListed = [element for element in BlackList if element in Query.upper()]
|
|
317
|
+
self.logger.erro(f'{__name__}: Este método não permite comandos DDL ou execução dinâmica. A query informada possui as seguintes palavras reservadas não aceitas: {BlackListed} e não foi executada!')
|
|
318
|
+
return None
|
|
319
|
+
else:
|
|
320
|
+
try:
|
|
321
|
+
self.Cursor = self.Conexao.cursor()
|
|
322
|
+
self.Cursor.execute(Query)
|
|
323
|
+
UpdRows = self.Cursor.rowcount
|
|
324
|
+
|
|
325
|
+
if Fetch and self.Cursor.description:
|
|
326
|
+
Dados = self.Cursor.fetchall()
|
|
327
|
+
Colunas = [Col[0] for Col in self.Cursor.description]
|
|
328
|
+
self.Conexao.commit()
|
|
329
|
+
self.Cursor.close()
|
|
330
|
+
return Dados, Colunas
|
|
331
|
+
|
|
332
|
+
self.Conexao.commit()
|
|
333
|
+
self.Cursor.close()
|
|
334
|
+
return UpdRows
|
|
335
|
+
except Exception as Err:
|
|
336
|
+
self.Conexao.rollback()
|
|
337
|
+
raise
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "lbxtoolkit"
|
|
3
|
-
version = "2.4.
|
|
3
|
+
version = "2.4.3"
|
|
4
4
|
description = "Caixa ferramentas da LBX para automações de processos (RPA), integrações, utilitários Windows e componentes reutilizáveis."
|
|
5
5
|
authors = ["Cristiano P. Ferrari <cristiano.ferrari@lbx.com.br>"]
|
|
6
6
|
readme = "README.md"
|
|
Binary file
|
|
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
|