Repository navigation
ConnectionPlus.Interface.QueryScalarOptions
tedious-plus / ConnectionPlus / QueryScalarOptions
Defined in: ConnectionPlus.ts:46
Options for ConnectionPlus.queryScalar.
DT extends JsValueDataType = JsValueDataType
dataType?: DT;Defined in: ConnectionPlus.ts:54
The expected data type of the returned value.
The data type is verified at runtime and determines the TypeScript type of the returned value.
Without this option, the value is returned with the type any.
paramDefArray?: SqlParamDef[];Defined in: TediousUtils.ts:371
This variant is used to specify full parameter definitions as an array.
Example:
[
{name: "p1", type: Tedious.TYPES.Int, value: 123},
{name: "p2", type: Tedious.TYPES.NVarChar, value: "abc"}
]CommonRequestOptions.paramDefArray
paramDefs?: Record<string, SqlParamValueAndDataType>;Defined in: TediousUtils.ts:358
This variant is used to specify full parameter definitions as an object.
Example:
{
p1: {type: Tedious.TYPES.Int, value: 123},
p2: {type: Tedious.TYPES.NVarChar, value: "abc"}
}CommonRequestOptions.paramDefs
params?: Record<string, unknown>;Defined in: TediousUtils.ts:334
This variant is used to specify parameter names and values.
Example: {p1: 123, p2: "abc"}
The data types are derived from the values (see deriveParamDataTypeFromValue).
CommonRequestOptions.params
paramValues?: unknown[];Defined in: TediousUtils.ts:345
This variant is used to specify only the parameter values.
Example: [123, "abc"]
The parameter names a, b, c, ... are generated (see genParamName), so the
parameters are referenced as @a, @b, @c, ... in the SQL code.
The data types are derived from the values (see deriveParamDataTypeFromValue).
CommonRequestOptions.paramValues
timeoutMs?: number;Defined in: ConnectionPlus.ts:24
The number of milliseconds before the request is considered failed, or 0 for no timeout.
When no timeout is set, the options.requestTimeout of the Connection is used.
CommonRequestOptions.timeoutMs