sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
13.45k stars 804 forks source link

SQLite: Add support for WHERE clause on the FTS5 Table Name #3204

Open ankitrgadiya opened 9 months ago

ankitrgadiya commented 9 months ago

What do you want to change?

SQLite supports WHERE clause directly over the Table name to query all the columns.

CREATE VIRTUAL TABLE IF NOT EXISTS ft
USING fts5(id, name, content);
SELECT name, snippet(ft, -1, "...", "...", "", 30)
FROM ft
WHERE ft MATCH @query

But SQLC does not work with this Query.

# package gen
query.sql:77:7: column "ft" does not exist

What database engines need to be changed?

SQLite

What programming language backends need to be changed?

Go

naspeh commented 2 months ago

I have created PR for this #3498.