|
|
@ -1,5 +1,6 @@
|
|
|
|
import psycopg2
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
|
|
|
|
import psycopg2
|
|
|
|
|
|
|
|
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
|
|
|
|
|
|
|
|
|
|
|
|
env_dbname = os.getenv('POSTGRES_DATABASE')
|
|
|
|
env_dbname = os.getenv('POSTGRES_DATABASE')
|
|
|
|
env_user = os.getenv('POSTGRES_USER')
|
|
|
|
env_user = os.getenv('POSTGRES_USER')
|
|
|
@ -7,12 +8,11 @@ env_password = os.getenv('POSTGRES_PASSWORD')
|
|
|
|
|
|
|
|
|
|
|
|
# Establish connection to the PostgreSQL database
|
|
|
|
# Establish connection to the PostgreSQL database
|
|
|
|
conn = psycopg2.connect(dbname="postgres", user=env_user, password=env_password, host="felixmielcarek-bigbrotherdb")
|
|
|
|
conn = psycopg2.connect(dbname="postgres", user=env_user, password=env_password, host="felixmielcarek-bigbrotherdb")
|
|
|
|
|
|
|
|
con.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
|
|
|
|
|
|
|
|
|
|
|
# Create a cursor object to execute SQL queries
|
|
|
|
# Create a cursor object to execute SQL queries
|
|
|
|
cur = conn.cursor()
|
|
|
|
cur = conn.cursor()
|
|
|
|
|
|
|
|
|
|
|
|
conn.autocommit = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create_db_query = '''
|
|
|
|
create_db_query = '''
|
|
|
|
-- Database: bigbrother
|
|
|
|
-- Database: bigbrother
|
|
|
|
|
|
|
|
|
|
|
|