kaykay-dv / pocketsearch

A simple full-text search library for Python using SQLite and its FTS5 extension
https://pocketsearch.readthedocs.io/en/latest/
MIT License
1 stars 0 forks source link

Problem with handling of multiple in-memory databases #54

Closed kaykay-dv closed 8 months ago

kaykay-dv commented 8 months ago

Multiple in-memory databases do not seem to be handled correctly now when closing. The connection handler does not correctly differentiate between the multiple databases so locks are not released correctly.

kaykay-dv commented 8 months ago

The connection pool class checks if no db_name is given. If no name is given, an in-memory database is assumed (so far the behaviour has not not changed). However, if no db_name is given, a GUID (generated and provided by the PocketSearch instance) is used as handle in the connection pool, so each in-memory database has their own db connection identified through the GUID.