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

fix(sqlite): allow using fts5 table name in the where clause #3498

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

Conversation

naspeh
Copy link

@naspeh naspeh commented Jul 22, 2024

Fixes: #3204

Allow using table name to the left of MATCH or equality operator.

Related:

@naspeh
Copy link
Author

naspeh commented Aug 6, 2024

@kyleconroy Thank you for sqlc !

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{
Copy link
Author

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          │
└───────────────────────────────────────────────────┴────────────┘

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.

SQLite: Add support for WHERE clause on the FTS5 Table Name
1 participant