RamiAwar / dataline

Chat with your data - AI data analysis and visualization on CSV, Postgres, MySQL, Snowflake, SQLite...
https://dataline.app
GNU General Public License v3.0
502 stars 49 forks source link

Avoid locking the db when querying #237

Closed anthony2261 closed 1 month ago

anthony2261 commented 1 month ago

Context

When we perform a write inside a transaction in SQLite, the database is locked until the transaction ends. So performing a write before starting the entire agentic workflow will lock the DB for quite a while.

Solution

Move the message write to directly before the result storage (lump all the writes together in time with no wait).