Skip to content

ConnectionPlus.Interface.QueryScalarOptions

Christian d'Heureuse edited this page Oct 28, 2026 · 1 revision

tedious-plus / ConnectionPlus / QueryScalarOptions

Interface: QueryScalarOptions<DT>

Defined in: ConnectionPlus.ts:46

Options for ConnectionPlus.queryScalar.

Extends

Type Parameters

DT

DT extends JsValueDataType = JsValueDataType

Properties

dataType?

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?

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"}
]

Inherited from

CommonRequestOptions.paramDefArray


paramDefs?

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"}
}

Inherited from

CommonRequestOptions.paramDefs


params?

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).

Inherited from

CommonRequestOptions.params


paramValues?

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).

Inherited from

CommonRequestOptions.paramValues


timeoutMs?

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.

Inherited from

CommonRequestOptions.timeoutMs

Clone this wiki locally