client.search
Full-text search across a table
Signature
class Client {
search<T>(table: string, query: string, opts?: { columns?: string[]; limit?: number }): Promise<Record<string, unknown>[]>
}
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| table | | yes | Table name |
| query | | yes | Search query text |
| opts | | no | Search options (columns?, limit?) |
Examples
import { Client } from '@blueforge/client'
const bf = new Client({ apiKey: process.env.BF_API_KEY!, url: 'https://your-project.blueforge.dev' })
const results = await bf.search('articles', 'deploy', { columns: ['title', 'body'], limit: 20 })
Throws
| Error | Condition |
|---|---|
| API request failed |
| Network issue |
Pitfalls
- Search index required — full-text search requires a search index on the table; queries against unindexed columns may fail or return empty results
- No fuzzy matching — the search is exact-token based; use the query builder for
patternsILIKE
See also
{auto-injected}
Tested against
{auto-injected}