diff --git a/create_db.py b/create_db.py new file mode 100644 index 0000000..c60fb3a --- /dev/null +++ b/create_db.py @@ -0,0 +1,23 @@ +import psycopg2 +from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT + +# Connect to the default database +conn = psycopg2.connect( + dbname='postgres', + user='melkor', + password='Th3leetnis!leadsdb', + host='barad-dur.lan.mgk.one', + port='5433' +) + +conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT) + +cur = conn.cursor() + +# Create the database +cur.execute('CREATE DATABASE leadsdb') + +cur.close() +conn.close() + +print("Database 'leadsdb' created successfully.")