-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededsqliteUpdates to sqlite codeUpdates to sqlite codetypescriptUpdates to Typescript codeUpdates to Typescript codeuxUpdates to user experienceUpdates to user experience
Milestone
Description
Description
When using common characters such as apostrophes (') and others, the search fails and throws a SQL error.
SQLite: near "s": syntax error
Sorry about that. A report has been filed. Please try a different search.
Repro
- Open https://transcript.fish
- Search "heaven's gate"
- See error
Screenshots
Additional info
The actual query gets created here.
const searchEpisodeWordsQuery = (searchTerm: string) => `
SELECT
episode
FROM
words_fts
WHERE
words_fts MATCH '${searchTerm}'
`;https://github.com/noman-land/transcript.fish/blob/master/src/js/database/queries.ts#L138-L145
It seems this needs to be a prepared statement instead string concat but I couldn't solve this the first time I tried.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededsqliteUpdates to sqlite codeUpdates to sqlite codetypescriptUpdates to Typescript codeUpdates to Typescript codeuxUpdates to user experienceUpdates to user experience
Projects
Status
Todo