Mercurial > repos > tduigou > seq_to_db
comparison verification.py @ 0:9f845ccb1a9f draft
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools commit 3401816c949b538bd9c67e61cbe92badff6a4007-dirty
| author | tduigou |
|---|---|
| date | Wed, 11 Jun 2025 13:36:44 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9f845ccb1a9f |
|---|---|
| 1 from sqlalchemy import create_engine, text | |
| 2 | |
| 3 db_uri = "postgresql://postgres:RK17@localhost:5432/test_fragments_db" # adapt with your URI's DB | |
| 4 engine = create_engine(db_uri) | |
| 5 | |
| 6 with engine.connect() as conn: | |
| 7 result = conn.execute(text(""" | |
| 8 SELECT fragment, sequence, annotation | |
| 9 FROM sample | |
| 10 ORDER BY fragment | |
| 11 """)) | |
| 12 | |
| 13 print("Full contents of fragments in DB:\n") | |
| 14 for row in result: | |
| 15 print(f" Fragment: {row.fragment}") | |
| 16 print(" Sequence:") | |
| 17 print(row.sequence) | |
| 18 print("\n Annotation:") | |
| 19 print(row.annotation) | |
| 20 print("-" * 80) |
