parkervg / blendsql

Query language for blending SQL logic and LLM reasoning across structured + unstructured data. [Findings of ACL 2024]
https://parkervg.github.io/blendsql/
Apache License 2.0
72 stars 4 forks source link

SQLalchemy Refactor - PostgreSQL support, `CREATE TEMP TABLE` logic, Guidance LlamaCpp Model class #10

Closed parkervg closed 5 months ago

parkervg commented 5 months ago

This PR attempts to make the underlying SQL adapter logic DBMS-agnostic, so that we can operate over most SQL-style databases, and not just SQLite.

Specifically, the Database class in ./blendsql/db/_database.py now uses sqlalchemy rather than sqlite3.

Additionally, the underlying 'temporary session table' logic was rewritten, so that we no longer manage cleaning-up of our temp tables within the Python level. Instead (and much more cleanly), we initialize all tables via CREATE TEMP TABLE commands, which work in both SQLite and PostgreSQL.

Other notable commits: