mirror of
https://github.com/simstudioai/sim.git
synced 2026-11-25 07:09:03 +08:00
* feat(docs): rebuild documentation with the Paper design system * fix(docs): verify nested tabs and fresh-checkout CI setup * chore(docs): refresh preservation evidence against latest staging * fix(docs): align shared navigation and controls with Paper * fix(docs): share active heading across responsive outlines * fix(docs): track the final section at the end of the page * fix(docs): preserve sidebar scroll in a persistent layout * fix(docs): restore live screenshot backgrounds and framing * fix(docs): finish layout polish and clean implementation references * fix(docs): align shared dark theme and overlay states * fix(docs): remove dark borders from platform screenshots * test(docs): benchmark production navigation and image delivery in CI * fix(docs): preserve machine content and production reading contracts * fix(docs): retain readable tabs without JavaScript and verify current staging * fix(docs): expose root response schemas and generate clean-checkout types * fix(docs): resolve no-script tabs in the preflight cascade layer * perf(docs): import only the search schema constructors * fix(docs): preserve retrieval excerpts and reduce reading overhead * fix(docs): reuse in-flight intent prefetches during navigation * docs: record production readiness evidence and release requirements * docs: clarify optimizer measurement provenance * docs: preserve latest staging Search assets and compatibility evidence * fix(docs): polish responsive controls and keep search indexing current * test(docs): select the visible API example in browser checks * test(docs): execute native examples against streaming and binary responses * fix(docs): stream native API responses without buffering * test(docs): cover review regressions through public interfaces * fix(docs): preserve accessible examples and gate index publication * fix(docs): finish accessible controls and cached content validation * fix(docs): validate integration parents and report partial search failures * fix(docs): refine navigation and compact sample controls * fix(docs): isolate synchronous corpus validation from HTTP readers * fix(docs): restore Paper interaction styling and verify responsive controls * fix(docs): score each search page once per retrieval source * fix(docs): attribute benchmark metrics to their source document --------- Co-authored-by: Waleed Latif <walif6@gmail.com>
21 lines
695 B
TypeScript
21 lines
695 B
TypeScript
import postgres from 'postgres'
|
|
|
|
let client: ReturnType<typeof postgres> | undefined
|
|
|
|
/** The public docs service has its own bounded pool, independent of platform request traffic. */
|
|
export function searchDatabase() {
|
|
if (client) return client
|
|
const url = process.env.DATABASE_URL
|
|
if (!url) throw new Error('DATABASE_URL is required for the optional hybrid search index')
|
|
client = postgres(url, {
|
|
max: 2,
|
|
connect_timeout: 2,
|
|
// Optional search must not wait through an outage's growing reconnect delay.
|
|
backoff: () => 0.1,
|
|
idle_timeout: 20,
|
|
prepare: false,
|
|
connection: { application_name: 'sim-docs-search', statement_timeout: 2000 },
|
|
})
|
|
return client
|
|
}
|