from data_source_holder import DataSourceHolder
_ds_holder = DataSourceHolder('py', 'scene')
cursor = _ds_holder.conn.cursor()
template_filepath = '/nas/workspace/kbae/Airflow_indexing_kbae/Scene_indexing/SQL/DDL_Templates/update_v3.sql'
with open(template_filepath, 'r') as template_file:
template = template_file.read()
cmd = template.replace('table', 'tbl_test_glc_21_planetscope_ship_scene')
print(cmd)
cursor.execute(cmd)
_ds_holder.conn.commit()
import psycopg2
def get_postgis_gcloud():
conn = psycopg2.connect(host="", port=, database="", user="", password="")
return conn
conn = get_postgis_gcloud()
cursor = conn.cursor()
cmd = 'SELECT * FROM data_paltfomr.tbl_sia_scenes'
cursor.execute(cmd)
result = cursor.fetchall()
print(result)
# conn.commit()