diff --git a/PostgressDocker/db_connection.py b/PostgressDocker/db_connection.py new file mode 100644 index 0000000..5f36471 --- /dev/null +++ b/PostgressDocker/db_connection.py @@ -0,0 +1,11 @@ +import psycopg2 as psyco + +conn = psyco.connect(dbname="aact_db", user="access", host="localhost", password="access") + +curse = conn.cursor() + +curse.execute("SELECT * FROM testing") +print(curse.fetchall()) + +curse.close() +conn.close() \ No newline at end of file diff --git a/PostgressDocker/docker-compose.yaml b/PostgressDocker/docker-compose.yaml index 1e6559d..8c62f3a 100644 --- a/PostgressDocker/docker-compose.yaml +++ b/PostgressDocker/docker-compose.yaml @@ -10,7 +10,7 @@ services: POSTGRES_PASSWORD: root POSTGRES_DB: aact_db ports: - - "3000:5432" #host:container + - "5432:5432" #host:container volumes: #host:container is the format. #pull in a single file #- $HOME/research/ClinicalTrialsDataProcessing/PostgressDocker/infile:/infile