Mercurial > repos > tduigou > seq_to_db
view verification.py @ 2:dad2c4c3450a draft default tip
planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools commit db4ac861e1d03fcdfe94321d858839124e493930-dirty
| author | tduigou |
|---|---|
| date | Wed, 23 Jul 2025 09:44:33 +0000 |
| parents | 9f845ccb1a9f |
| children |
line wrap: on
line source
from sqlalchemy import create_engine, text db_uri = "postgresql://postgres:RK17@localhost:5432/test_fragments_db" # adapt with your URI's DB engine = create_engine(db_uri) with engine.connect() as conn: result = conn.execute(text(""" SELECT fragment, sequence, annotation FROM sample ORDER BY fragment """)) print("Full contents of fragments in DB:\n") for row in result: print(f" Fragment: {row.fragment}") print(" Sequence:") print(row.sequence) print("\n Annotation:") print(row.annotation) print("-" * 80)
