// EXECUTOR (server-only): returns a query builder. `.matching('bookSearch', // input.q)` compiles to the dialect's FTS predicate (postgres tsvector, // mysql/mariadb MATCH…AGAINST, sqlite FTS5, mssql ranked-LIKE) — resolving // the index's covered columns + config from the `bookSearch` declaration on // the `books` table. // // We do NOT add a tenant filter by hand — `books` carries the `tenant()` // mixin, so the runtime AND-merges `eq('tenantId', subject.tenantId)` into // the predicate automatically. import type { AppContext } from '@voltro/runtime' import { database } from '../database/index' const execute = (input: { q: string }, _ctx: AppContext) => database.books.matching('bookSearch', input.q).limit(50) export default execute