UNPKG

tedious

Version:

A TDS driver, for connecting to MS SQLServer databases.

29 lines (28 loc) • 1.64 kB
import WritableTrackingBuffer from './tracking-buffer/writable-tracking-buffer'; import { type ResolvedParameter } from './data-type'; import { type InternalConnectionOptions } from './connection'; declare class RpcRequestPayload implements AsyncIterable<Buffer> { procedure: string | number; parameters: ResolvedParameter[]; options: InternalConnectionOptions; txnDescriptor: Buffer; constructor(procedure: string | number, parameters: ResolvedParameter[], txnDescriptor: Buffer, options: InternalConnectionOptions); /** * The request is written into one buffer whose contents are yielded once * it holds a chunk's worth (`WritableTrackingBuffer.CHUNK_SIZE`), checked * after every parameter, and at the end. A large value written by * reference stays by reference, so this costs no extra copy. A parameter * whose value is read from a source while the request is written has the * rest of that write returned by `writeValue`, and is driven here so that * the buffer is handed on whenever the type says it is worth it. * * Chunks are yielded one by one rather than through `yield*`: an array * iterator has no `throw` method, so an error a consumer throws into this * generator during such a delegation would surface as a TypeError instead. */ [Symbol.asyncIterator](): AsyncGenerator<Buffer<ArrayBufferLike>, void, unknown>; toString(indent?: string): string; writeHeader(buffer: WritableTrackingBuffer): void; writeParameterHeader(buffer: WritableTrackingBuffer, parameter: ResolvedParameter): void; } export default RpcRequestPayload;