Mercurial > repos > charles_s_test > seqsero
comparison psql_test.py @ 2:381e1e7109fc draft default tip
planemo upload commit 464b391afaa5819bc681452e85bea9d882730eb6-dirty
| author | charles_s_test |
|---|---|
| date | Sun, 12 Nov 2017 02:26:17 -0500 |
| parents | 139f1e77d834 |
| children |
comparison
equal
deleted
inserted
replaced
| 1:139f1e77d834 | 2:381e1e7109fc |
|---|---|
| 1 import psycopg2, os | |
| 2 | |
| 3 os.system('source /nfs/sw/apps/galaxy-dev/galaxy/.venv/bin/activate') | |
| 4 | |
| 5 connection = psycopg2.connect(database="galaxy", user="galaxy", host="galaxydev.cvkyaz9id4ml.us-east-1.rds.amazonaws.com", password="cF$cl0udh9c", port="5432") | |
| 6 print "monkey made a connection!" | |
| 7 | |
| 8 worker = connection.cursor() | |
| 9 worker.execute('SELECT name FROM library_dataset_dataset_association WHERE dataset_id = 4;') | |
| 10 result = worker.fetchall() | |
| 11 print result, '4' | |
| 12 | |
| 13 worker = connection.cursor() | |
| 14 worker.execute('SELECT name FROM library_dataset_dataset_association WHERE dataset_id = 10;') | |
| 15 result = worker.fetchall() | |
| 16 print result, '10' | |
| 17 | |
| 18 worker = connection.cursor() | |
| 19 worker.execute('SELECT name FROM library_dataset_dataset_association WHERE dataset_id = 11;') | |
| 20 result = worker.fetchall() | |
| 21 print result, '11' | |
| 22 | |
| 23 worker = connection.cursor() | |
| 24 worker.execute('SELECT name FROM library_dataset_dataset_association WHERE dataset_id = 18;') | |
| 25 result = worker.fetchall() | |
| 26 print result, '18' |
