-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.py
15 lines (14 loc) · 885 Bytes
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if __name__ == "__main__":
from sqlalchemy import create_engine
import pandas as pd
# Postgres username, password, and database name
POSTGRES_ADDRESS = 'localhost' ## INSERT YOUR DB ADDRESS IF IT'S NOT ON PANOPLY
POSTGRES_PORT = '4566'
POSTGRES_USERNAME = 'root' ## CHANGE THIS TO YOUR PANOPLY/POSTGRES USERNAME
POSTGRES_PASSWORD = '' ## CHANGE THIS TO YOUR PANOPLY/POSTGRES PASSWORD
POSTGRES_DBNAME = 'dev' ## CHANGE THIS TO YOUR DATABASE NAME
# A long string that contains the necessary Postgres login information
postgres_str = ('risingwave://{username}:{password}@{ipaddress}:{port}/{dbname}'.format(username=POSTGRES_USERNAME, password=POSTGRES_PASSWORD, ipaddress=POSTGRES_ADDRESS, port=POSTGRES_PORT, dbname=POSTGRES_DBNAME))
# Create the connection
cnx = create_engine(postgres_str)
pd.read_sql_query('''SELECT 1+1;''', cnx)