add variables to .env-example
This commit is contained in:
parent
7867e73f10
commit
69f9ff1793
2 changed files with 7 additions and 5 deletions
|
|
@ -1,2 +1,8 @@
|
||||||
XE_ACCOUNT_ID=<your-account-id-here>
|
XE_ACCOUNT_ID=<your-account-id-here>
|
||||||
XE_API_KEY=<your-api-key-here>
|
XE_API_KEY=<your-api-key-here>
|
||||||
|
|
||||||
|
DWH_HOST=<db-host-here>
|
||||||
|
DWH_PORT=<db-port-here>
|
||||||
|
DWH_DB=<db-db-here>
|
||||||
|
DWH_USER=<db-user-here>
|
||||||
|
DWH_PASSWORD=<db-password-here>
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,8 @@ class DWHRateWriter(RateWriter):
|
||||||
schema = DWH_SCHEMA
|
schema = DWH_SCHEMA
|
||||||
table = DWH_TABLE
|
table = DWH_TABLE
|
||||||
|
|
||||||
try:
|
|
||||||
# Start a transaction
|
|
||||||
self.connection.autocommit = False
|
self.connection.autocommit = False
|
||||||
|
try:
|
||||||
# Check if schema exists
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
sql.SQL(
|
sql.SQL(
|
||||||
"SELECT schema_name FROM information_schema.schemata WHERE schema_name = %s;"
|
"SELECT schema_name FROM information_schema.schemata WHERE schema_name = %s;"
|
||||||
|
|
@ -84,7 +81,6 @@ class DWHRateWriter(RateWriter):
|
||||||
if not schema_exists:
|
if not schema_exists:
|
||||||
raise Exception(f"Schema '{schema}' does not exist.")
|
raise Exception(f"Schema '{schema}' does not exist.")
|
||||||
|
|
||||||
# Check if table exists
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
sql.SQL(
|
sql.SQL(
|
||||||
"SELECT table_name FROM information_schema.tables WHERE table_schema = %s AND table_name = %s;"
|
"SELECT table_name FROM information_schema.tables WHERE table_schema = %s AND table_name = %s;"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue