Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SQL type

JS → SQL (parameter)

SQL → JS (result)

Comment

tinyint, smallint, int, bigint

String: deserialize,

Int: 1-to-1,

Double: convert

Int: 1-to-1

Others - convert as is

bit

String: "true"/"false", "y"false" /"n", integers, doubles are converted, all others - failureODBC side conversion

Int: 0 , 1 are converted, all - false,  all others - failuretrue

Double: 0.0 - false, >0 NaN - truenull, all other others - failuretrue.

Always converted to:
Int: 0, 1

Others: convert to "0"/"1", 0.0/1.0

decimal, numeric, money, smallmoney

String: ODBC-side conversion.
Int: ODBC-side conversion.

Double: fail if extraParams.useStrictDecimal

String: "123.456"
Int: "123"
Double: ~123.456, fail if extraParams.useStrictDecimal

float,real

String: deserialize,

Int: convert,

Double: 1-to-1.

Double: 1-to-1.
Others - convert as is

date, time, datetime2, datetimeoffset, datetime

smalldatetime

String: try converting from FIX date, if succeeds fill the ODBC:DATE_TIME struct; if fails pass by to ODBC as string.

Int: Try to interpret as JSDateEntity, if failed treat as unix time. Pass to ODBC:DATE_TIME struct in both cases.

Double: Convert to unix time and pass to ODBC:DATE_TIME struct.

If no conversion requested, returns and int, representing a JSDateEntity.

String: Convert to FIX date format

Int: Convert to Unix timestamp.

Double: Convert to Unix timestamp.

Several useful JS bindings for manipulating JSDateEntity objects are: dateToString, getDateField, createDate, getCurrentDate, (get | set | change)(Year | Month | ... | Sec|MSec|NSec)

char, varchar, nchar, nvarchar

String: 1-to-1,

Int: serialize

double: serialize

String: 1-to-1

Others - convert as is

text, ntext

Not supported as these types are obsolete/deprecated.

binary, varbinary, image

String: passed as is,

Int: passed as binary uint64_t* buffer,

Double: passed as binary double* buffer.

String: example: 0xdeadbeef -> "DEADBEEF"

Others - convert as is

cursor, geography, geometry, hierarchyid,

json, rowversion, sql_variant, table, uniqueidentifier, xml

All: passed as is 

All: read as is

Arrays of values

Not implemented