-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
docker pull metabase/metabase:latest | ||
docker run -d -p 3000:3000 --name metabase --platform linux/amd64 metabase/metabase | ||
# test@example.com / 1test@example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import psycopg2 | ||
from psycopg2 import Error | ||
|
||
try: | ||
# Connect to an existing database | ||
connection = None | ||
connection = psycopg2.connect( | ||
user="bemidb", | ||
password="bemidb", | ||
host="127.0.0.1", | ||
port="5432", | ||
database="tpch" | ||
) | ||
|
||
print("Connected") | ||
cursor = connection.cursor() | ||
|
||
print("Querying") | ||
# cursor.execute("SELECT 1") | ||
cursor.execute("SET datestyle TO 'ISO'") | ||
record = cursor.fetchone() | ||
print("You are connected to - ", record) | ||
|
||
except (Exception, Error) as error: | ||
print("Error while connecting to PostgreSQL:", error) | ||
|
||
finally: | ||
if connection: | ||
cursor.close() | ||
connection.close() | ||
print("PostgreSQL connection is closed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import psycopg2 | ||
from psycopg2 import Error | ||
|
||
try: | ||
# Connect to an existing database | ||
connection = None | ||
connection = psycopg2.connect( | ||
user="bemidb", | ||
password="bemidb", | ||
host="127.0.0.1", | ||
port="54321", | ||
database="bemidb" | ||
) | ||
|
||
print("Connected") | ||
# cursor = connection.cursor() | ||
# | ||
# print("Querying") | ||
# cursor.execute("SELECT 1") | ||
# record = cursor.fetchone() | ||
# print("You are connected to - ", record) | ||
|
||
except (Exception, Error) as error: | ||
print("Error while connecting to PostgreSQL:", error) | ||
|
||
finally: | ||
if connection: | ||
cursor.close() | ||
connection.close() | ||
print("PostgreSQL connection is closed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pip install psycopg2-binary | ||
python psycopg2-test.py |