GitHub

API reference for types.

SQL Server parameter types (tedious's TYPES and ParameterOptions, which Effect's @effect/sql-mssql takes in param, procedure parameters and parameterTypes).

A DataType names the type a parameter is sent as; ParameterOptions sizes it as tedious's options do: length for character and binary types (by default the value's length, up to 4000 characters or 8000 bytes, then MAX), precision / scale for Decimal / Numeric (18 and 0) and scale for Time, DateTime2 and DateTimeOffset (7)::

sql("SELECT * FROM people WHERE id = {}", client.param(TYPES.BigInt, 1))

Values

AttributeTypeDescription
default_parameter_typesFinal[ParameterTypes]

Effect's defaultParameterTypes: strings as NVarChar (Unicode), floats as Float (JavaScript's numbers), ints as BigInt (its bigints), bytes as VarBinary, None as a Bit NULL.

Types

TypeDefinitionDescription
DataTypeNametype DataTypeName = Literal['Bit', 'TinyInt', 'SmallInt', 'Int', 'BigInt', 'Real', 'Float', 'SmallMoney', 'Money', 'Decimal', 'Numeric', 'Char', 'VarChar', 'NChar', 'NVarChar', 'Text', 'NText', 'Binary', 'VarBinary', 'Image', 'UniqueIdentifier', 'Xml', 'Date', 'Time', 'SmallDateTime', 'DateTime', 'DateTime2', 'DateTimeOffset']
ParameterTypestype ParameterTypes = Mapping[PrimitiveKind, DataType]

The type each kind of plain value is sent as.

Classes