Best practices to sanitize/format input for sqlite?

Hello, I am using expo-sqlite for all the data storage on my app. I am running into the problem where certain strings are breaking the database. While the orm on the server side does most of the formatting, when that same data gets to the expo-sqlite db, it breaks with “Error: unrecognized token” in response to common symbols like the apostrophe. So I am making this post to ask what are the best practices to move data in and out of the database? Are there any libraries that can do this and protect against certain attacks as well?

Thank you, John

Unless I find a better way in the future, I’ve found that sqlstring-sqlite - npm works well if I apply it to whatever value I am to write.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.