[PR #514] [MERGED] fix(db): avoid using dash in fts5 queries #635

Closed
opened 2026-02-25 23:34:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/514
Author: @fmartingr
Created: 10/12/2022
Status: Merged
Merged: 10/15/2022
Merged by: @fmartingr

Base: masterHead: issue-492


📝 Commits (4)

  • f01c843 fix(sqlite): avoid using dash in fts5 queries
  • 76426e6 test(db): get bookmarks and count with dash in keyword
  • fa5b74a test(db): common and ad-hoc sqlite test case
  • f6e0040 Merge branch 'master' into issue-492

📊 Changes

3 files changed (+97 additions, -6 deletions)

View changed files

📝 internal/database/database_test.go (+44 -1)
📝 internal/database/sqlite.go (+11 -5)
📝 internal/database/sqlite_test.go (+42 -0)

📄 Description

Replaces the dash (-) in keyword for the FTS5 arguments in SQLite, since that's a column token for the engine, so queries coming from the search with a dash where trying to find a column where the user would just want a keyword match.

Added some tests to handle this behavior.

Fixes #492


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/514 **Author:** [@fmartingr](https://github.com/fmartingr) **Created:** 10/12/2022 **Status:** ✅ Merged **Merged:** 10/15/2022 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `issue-492` --- ### 📝 Commits (4) - [`f01c843`](https://github.com/go-shiori/shiori/commit/f01c843d6769c8409b18b90d0542bbb10f385f8a) fix(sqlite): avoid using dash in fts5 queries - [`76426e6`](https://github.com/go-shiori/shiori/commit/76426e6ada3c4203757a6fe10792ea17149e91e1) test(db): get bookmarks and count with dash in keyword - [`fa5b74a`](https://github.com/go-shiori/shiori/commit/fa5b74a1c08437fd466fe1e6faa84f8e920f6f47) test(db): common and ad-hoc sqlite test case - [`f6e0040`](https://github.com/go-shiori/shiori/commit/f6e0040535ae22951ebdaa5fcd89c06e8399d131) Merge branch 'master' into issue-492 ### 📊 Changes **3 files changed** (+97 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/database_test.go` (+44 -1) 📝 `internal/database/sqlite.go` (+11 -5) 📝 `internal/database/sqlite_test.go` (+42 -0) </details> ### 📄 Description Replaces the dash (`-`) in keyword for the FTS5 arguments in SQLite, since that's a column token for the engine, so queries coming from the search with a dash where trying to find a column where the user would just want a keyword match. Added some tests to handle this behavior. Fixes #492 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:34:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#635
No description provided.