-
Notifications
You must be signed in to change notification settings - Fork 831
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
fix(sqlite): allow using fts5 table name in the where clause #3498
base: main
Are you sure you want to change the base?
Conversation
@kyleconroy Thank you for Could you look at this PR, please? I have to use my fork as a workaround. Would love to get this in the official package. |
@@ -168,6 +168,12 @@ func (c *cc) convertCreate_virtual_table_fts5(n *parser.Create_virtual_table_stm | |||
} | |||
} | |||
|
|||
stmt.Cols = append(stmt.Cols, &ast.ColumnDef{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be fine to include the fts5 table name in the column list, as SQLite supports this as well
sqlite> SELECT key, emails_fts FROM emails_fts limit 1;
┌───────────────────────────────────────────────────┬────────────┐
│ key │ emails_fts │
├───────────────────────────────────────────────────┼────────────┤
│ 1708522984.M224116P268.c18ac5293f65,S=3578,W=3701 │ 5 │
└───────────────────────────────────────────────────┴────────────┘
Could you please rebase this on the latest main? The tests didn't run when it was originally opened. |
d2e447d
to
a4bbafc
Compare
@kyleconroy Done 🟢! |
is this going to be merged anytime soon? |
@naspeh I am joining the FTS5 table in a query and use it in WHERE. This does not seem to work on your branch. Expected behavior? |
@awgaan it should work, I think. I can't check, I lost context for this branch as I stopped using sqlc on the project. |
Turns out sqlc treats |
Fixes: #3204
Allow using table name to the left of MATCH or equality operator.
Related: