Open
Description
Hi,
So I've been using this package a few days now building a system.
I'm using this package to "cache" SQL table data so I can use it locally later.
It's supposed to update the "cache" weekly, or when the app is restarted.
What the problem is that sometimes when the json file already exists it fails to push the new data giving the error of: "Can't Load Database"
And the inner error of: "SyntaxError: Unexpected end of JSON input"
This gets resolved if I delete the existing files and run it again, but if that's the only fix currently I cant use this very useful package.
Some code example: (this runs everytime the app is started for several tables)
let dataToCache = await knex.raw(`SELECT * FROM [BTS].[dbo].[BTSStatusConv] ORDER BY [BTSStatusConv].SystemID , [BTSStatusConv].StatusID`);
for (let i = 0; i < dataToCache.length; i++) {
db.push(`/${dataToCache[i].SystemID}_${dataToCache[i].StatusID}`, dataToCache[i]);
}
Am I using this package wrong? Is it an actual bug?
Thanks
Metadata
Metadata
Assignees
Labels
No labels