Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rowid column to FTS5 tables #3902

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajeetdsouza
Copy link

Fixes #3901:

When creating a virtual table like so:

CREATE VIRTUAL TABLE my_fts USING fts5 (
    name,
    description,
    content = '',
    contentless_delete = 1,
    tokenize = 'porter'
);

SQLite automatically adds an extra rowid (int64) column to all fts5 virtual tables. However, this is not reflected in the schema. When I add a query like this:

-- name: InsertMyFTS :exec
INSERT INTO
    my_fts (rowid, name, description)
VALUES
    (?, ?, ?);

and call sqlc generate, I get this error:

query.sql:12:1: column "rowid" does not exist

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 🔧 golang labels Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files. 🔧 golang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rowid doesn't work with SQLite FTS5 tables
1 participant