The mesh-catalog container goes with its Dockerfile, build bases, bus credential and mesh-state directory. Its words are the database URL file where the mesh writes it. `pg` is a dependency in its package.json, which the builder now installs and inlines into the bundle (mesh-controller: a TypeScript bundle installs its module's own packages). `prepares: true` needs a container running the module's own artifact, so it becomes what ADR 0198 §3 says it is: prepare/index.js run by node as a run-once process, with the same words and no bus, before the runtime is started with the version that needs it, and again when the database URL changes.
23 lines
1.3 KiB
TypeScript
23 lines
1.3 KiB
TypeScript
// Ambient types for `pg` (node-postgres), which ships its types only via the separate `@types/pg`
|
|
// package. Rather than pull that in at tsc time, this declares the exact slice model-usage uses —
|
|
// the same precedent anthropic-manager sets for `tweetnacl-sealedbox-js` (a local ambient .d.ts,
|
|
// listed in tsconfig `include`, default-imported). The real `pg` is the package.json dependency the
|
|
// builder installs and inlines into the module's bundle (novox/hq ADR 0198 §4), so this types the
|
|
// code without deciding what runs.
|
|
declare module "pg" {
|
|
/** One checked-out connection. Needed because registering a module-version and its edges is one
|
|
* act: a half-written registration is a graph that lies about what something was built against. */
|
|
export class PoolClient {
|
|
query(text: string, params?: unknown[]): Promise<{ rows: any[]; rowCount: number }>;
|
|
release(): void;
|
|
}
|
|
/** A lazily-connecting connection pool. Only the connection string, one query form, checking out
|
|
* a connection, and end() are used here. */
|
|
export class Pool {
|
|
constructor(config?: { connectionString?: string });
|
|
query(text: string, params?: unknown[]): Promise<{ rows: any[]; rowCount: number }>;
|
|
connect(): Promise<PoolClient>;
|
|
end(): Promise<void>;
|
|
}
|
|
}
|