Skip to content

Commit

Permalink
Create get_contracts.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 8, 2024
1 parent 17d7308 commit 94998ca
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from sqlalchemy import create_engine
from contract_sphere_db.models import Contract

engine = create_engine('postgresql://user:password@localhost/contract_sphere_db')

def get_contracts():
with engine.connect() as conn:
result = conn.execute(Contract.select())
return [dict(row) for row in result]

0 comments on commit 94998ca

Please sign in to comment.