The mesh-mssql container goes with its Dockerfile (and the sqlcmd it fetched), build bases and bus credential. The client speaks TDS through the mssql driver its package.json names, inlined into the bundle by the builder (ADR 0198 §4): one session per call as one sqlcmd invocation was, FOR JSON rendering rows exactly as before, the consumer's password checked as a bound parameter. A caller's statement still runs only as the reader login (issue 193); the one-line rule and -x guarded against sqlcmd's own commands and variable substitution, which no longer stand between the caller and the server. The server is reached on loopback at the port the machine published (${port:1433}). The reader test drives a fake session in place of a fake sqlcmd.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
// Ambient types for `mssql`, which ships its types only in the separate `@types/mssql` package. This
|
|
// declares the slice client.ts uses — the precedent mesh-catalog's pg.d.ts sets — so the module
|
|
// type-checks without deciding what runs: the real `mssql` is the package.json dependency the
|
|
// builder installs and inlines into the bundle (novox/hq ADR 0198 §4).
|
|
declare module "mssql" {
|
|
interface Result {
|
|
recordsets: unknown;
|
|
}
|
|
interface Request {
|
|
input(name: string, type: unknown, value: unknown): Request;
|
|
query(text: string): Promise<Result>;
|
|
batch(text: string): Promise<Result>;
|
|
}
|
|
class ConnectionPool {
|
|
constructor(config: {
|
|
server: string;
|
|
port?: number;
|
|
user?: string;
|
|
password?: string;
|
|
database?: string;
|
|
options?: { encrypt?: boolean; trustServerCertificate?: boolean };
|
|
pool?: { min?: number; max?: number };
|
|
connectionTimeout?: number;
|
|
requestTimeout?: number;
|
|
});
|
|
connect(): Promise<ConnectionPool>;
|
|
request(): Request;
|
|
close(): Promise<void>;
|
|
}
|
|
const sql: { ConnectionPool: typeof ConnectionPool; NVarChar: unknown };
|
|
export default sql;
|
|
}
|