Marco De Paoli

Results 10 comments of Marco De Paoli

I built a test case to show what @aaugustin described. I hope the comments in the code make it explicative so that the test cases can be used as a...

A proposal: ``` from django.db import close_old_connections, reset_queries, transaction import rq class TransactionWorker(rq.Worker): def perform_job(self, job): reset_queries() close_old_connections() try: with transaction.atomic(): super(TransactionWorker, self).perform_job(job) finally: close_old_connections() ``` I have extended a...

... Maybe the "transaction.atomic" could be activated only if `settings.DATABASES["default"]["ATOMIC_REQUESTS"]` is set ...

I changed my mind. I think it is better I don't overlap responsibilities between transaction-management and connection-management The user should simply simply use the decorator transaction.atomic to wrap job execution...

> [@octalpixel](https://github.com/octalpixel) [@johantandy](https://github.com/johantandy) any of you willing to take care of this using the connection context properly? > > I would suggest taking a look at this first 👇 https://www.psycopg.org/psycopg3/docs/basic/usage.html#connection-context...

Currently, two main actions occur during connection setup: - Some preliminary setup operations are performed (e.g., drop, create, create index, etc.). - Two cursors are created. I like @phiweger’s suggestion...

Thinking about it... @phiweger’s suggestion doesn't solve OP problem I'm considering that the best thing is to have DocumentStore connect when needed, execute the appropriate sql and then disconnect (without...

I built a test case https://github.com/depaolim/haystack-core-integrations/blob/issue_847/integrations/pgvector/tests/test_document_store.py#L48 And I've approached a solution (which I'm far from satisfied with at the moment!) The key is to wrap automatically each method and build...

I believe there’s a simpler and more deliberate approach: split the functionality into two classes—`PgvectorDocumentStore` and `PgvectorDocumentStoreConnected`. 1. `PgvectorDocumentStore`: This class would have the same interface as the current one,...