diff options
author | navanchauhan <navanchauhan@gmail.com> | 2022-05-22 11:40:27 -0600 |
---|---|---|
committer | navanchauhan <navanchauhan@gmail.com> | 2022-05-22 11:40:27 -0600 |
commit | 04e733f16889494d23cf3fedaf9f281ddc057fff (patch) | |
tree | 314707e28842abb651f716d1784ae384acc1a0c1 | |
parent | 1848135c48044ddfb85b3a707afe102e3893986b (diff) |
pinecone 2 records
-rw-r--r-- | pc2rec.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pc2rec.py b/pc2rec.py new file mode 100644 index 0000000..d427dad --- /dev/null +++ b/pc2rec.py @@ -0,0 +1,16 @@ +from database import * +from sqlalchemy.sql import select + +database_url = "sqlite:///jlm.db" + +engine, Session = init_db_stuff(database_url) + +from sqlalchemy import func + +movie_name = "Forrest Gump" + +with engine.connect() as conn: + movie_deets = select(movies_table).filter(func.lower(movies_table.columns.title)==func.lower(movie_name)) + result = conn.execute(movie_deets) + for row in result: + print(row)
\ No newline at end of file |