Skip to content

Conversation

@watbe
Copy link

@watbe watbe commented Oct 28, 2025

FTS5 tables have different hidden columns compared to FTS3 and FTS4: https://www.sqlite.org/fts5.html#sorting_by_auxiliary_function_results

This PR does the following:

  1. Change the synthesizedColumns logic to differentiate FTS3 and 4 from FTS5.
  2. Add rank, rowid and _rowid_ to the list of synthesizedColumns for FTS5
  3. Add some tests

Fixes related problem sqldelight/sqldelight#5981

This does not prevent users from attempting to create invalid FTS5 tables using rank or rowid as column names, but they'll get an error at runtime from sqlite anyway.

Thanks to @griffio for the pointer from the linked issue!


  • CHANGELOG.md's "Unreleased" section has been updated, if applicable.

@watbe watbe changed the title Bug/fix fts5 rank hidden column Improve handling of FTS5 hidden columns Oct 28, 2025
@griffio
Copy link
Contributor

griffio commented Oct 29, 2025

😎 Cool - You can add a line e.g Improve handling of FTS5 hidden columns in the https://github.com/sqldelight/sql-psi/blob/master/CHANGELOG.md "Unreleased" section with the PR number

@watbe
Copy link
Author

watbe commented Oct 29, 2025

Done, thanks for taking a look!

@watbe
Copy link
Author

watbe commented Nov 4, 2025

See corresponding PR: sqldelight/sqldelight#5986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants