I'm currently making a NodeJS application and I'm using SQLite as the backend database. I've run into a problem when trying to soft-delete entries in a table. When I use the application to change the 'deleted' attribute, the changes appear in the SQLite CLI, but the application still displays each record as not deleted. These are the steps I use to test the application and database:
These are the steps I have take to try and resolve the issue:
After all this testing I believe the application is writing to the actual database file, but is reading from a cache. Is this an accurate conclusion? If so, how do I tell the application to refresh it's cache after executing an update query?
The application was writing to the database file, and reading from the same database, not a cache. However my query was set up to SELECT * FROM table1 LEFT OUTER JOIN table2 LEFT OUTER JOIN table3 LEFT OUTER JOIN table4
. table1, table2 and table3 all have a column called "deleted". I was updating table1.deleted
but reading table2.deleted
. I've amended the query to only select the columns I need from now on!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.