From 086706c6ae768806701197a79dde6fd4e99a472c Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Fri, 13 Oct 2023 20:14:06 +0200 Subject: [PATCH] SQL --- dbtestcall.py | 20 ++++++++++++++++++++ requirements.txt | 1 + 2 files changed, 21 insertions(+) create mode 100644 dbtestcall.py diff --git a/dbtestcall.py b/dbtestcall.py new file mode 100644 index 0000000..c919d90 --- /dev/null +++ b/dbtestcall.py @@ -0,0 +1,20 @@ +import math +import pg8000.native + +def Main(): + # con = pg8000.native.Connection('postgres', password='postgres', host='localhost', port=5432, database='da11copy') + con = pg8000.native.Connection('query_user', password='Udoz4nahbeethohb', host='localhost', port=5432, database='da11copy') + result = con.run( + """ + SELECT + signature, RTRIM(NULLIF(errors, '')) as errors, + is_executed, is_confirmed, + cu_requested, prioritization_fees + FROM banking_stage_results.transaction_infos + """) + for row in result: + print(row) + +if __name__=="__main__": + Main() + diff --git a/requirements.txt b/requirements.txt index 63d80a5..68d0cc1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ gunicorn==20.1.0 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.2 +pg8000==1.30.2 Werkzeug==2.3.3