Fixed how the connection was returned
This commit is contained in:
parent
f415226b76
commit
062944b57a
|
@ -4,11 +4,11 @@ import dotenv
|
|||
import os
|
||||
|
||||
def main():
|
||||
cursor = connect()
|
||||
cursor = connect().cursor()
|
||||
# cursor.execute("SELECT * FROM DB_table WHERE id = 1")
|
||||
|
||||
|
||||
def connect():
|
||||
global conn
|
||||
dotenv.load_dotenv()
|
||||
conn = psycopg2.connect(
|
||||
database=os.getenv('POSTGRES_DB'),
|
||||
|
@ -17,5 +17,6 @@ def connect():
|
|||
user=os.getenv('POSTGRES_USER'),
|
||||
password=os.getenv('POSTGRES_PASSWORD')
|
||||
)
|
||||
return conn
|
||||
|
||||
main()
|
Loading…
Reference in New Issue