amazon-textract-textractor icon indicating copy to clipboard operation
amazon-textract-textractor copied to clipboard

TGeoFinder should have a method to reset the in memory sqlite database

Open MacHu-GWU opened this issue 2 years ago • 1 comments

Hi @Belval

  1. I find out that every time when you create the TGeoFinder class from the JSON data, you actually generate a uuid for this object and insert lot of data into the sqlite lite database. I suggest adding a optional parameter when you create TGeoFinder object, allow user to explicitly pass unique identifier as a key, so user can explicitly delete all records related to this object in database in case the original object is already garbage collected.
  2. consider adding an explicit method instead of doing del t_geo_finder object for more Pythonic API.

Wonderful library!

MacHu-GWU avatar Dec 05 '22 03:12 MacHu-GWU

Hi @MacHu-GWU ,

Trying to understand the exact problem.

Being able to pass in the UUID could make sense, but you got the generated UUID in self.textract_doc_uuid in the TGeoFinder and can use that to delete everything through the delete method in OCRDB, which is also used to delete the OCRDB when the TGeoFinder object is garbage collected.

Maybe you can detail the lifecycle or give a sample where the problem occurs.

Glad you like the lib :-)

schadem avatar Dec 05 '22 19:12 schadem