(ctx Context, ti sdata.DBTable, ex *qcode.Exp)
| 332 | } |
| 333 | |
| 334 | func (d *SQLiteDialect) RenderTsQuery(ctx Context, ti sdata.DBTable, ex *qcode.Exp) { |
| 335 | // SQLite FTS5: For content-backed FTS, we need to query the FTS virtual table |
| 336 | // and match rowid with the main table's primary key. |
| 337 | // The FTS table name is typically the main table name suffixed with "_fts" |
| 338 | ftsTableName := ti.Name + "_fts" |
| 339 | |
| 340 | ctx.WriteString(`(`) |
| 341 | ctx.ColWithTable(ti.Name, ti.PrimaryCol.Name) |
| 342 | ctx.WriteString(` IN (SELECT rowid FROM `) |
| 343 | ctx.Quote(ftsTableName) |
| 344 | ctx.WriteString(` WHERE `) |
| 345 | ctx.Quote(ftsTableName) |
| 346 | ctx.WriteString(` MATCH `) |
| 347 | if ex.Right.ValType == qcode.ValStr { |
| 348 | d.RenderLiteral(ctx, ex.Right.Val, ex.Right.ValType) |
| 349 | } else { |
| 350 | ctx.AddParam(Param{Name: ex.Right.Val, Type: "text"}) |
| 351 | } |
| 352 | ctx.WriteString(`))`) |
| 353 | } |
| 354 | |
| 355 | func (d *SQLiteDialect) RenderSearchRank(ctx Context, sel *qcode.Select, f qcode.Field) { |
| 356 | ctx.WriteString(`rank`) // FTS5 'rank' column |
nothing calls this directly
no test coverage detected