You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A plain JS array of booleans, Dates, bigints or Buffers binds as a single value #45
inferType types a JS array by its first element (src/types.js, Array.isArray(x) ? inferType(x[0])). For strings and numbers that is 0, so the server's reported array type picks the array serializer. For booleans, Dates, bigints and Buffers the element type is non-zero, so Parse declares the scalar type (for example boolean) for a value that is an array. The query fails or binds wrongly. Only sql.array(value) works today.
Expected: a plain JS array is declared as the matching array type (bool[], timestamptz[], int8[], bytea[]), or left untyped for the server to decide.
Reported upstream as porsager#471; proposed fixes porsager#1050, porsager#533 and porsager#1032. By reading, select ${ [true, false] }::bool[] fails with "cannot cast type boolean to boolean[]". The same inference breaks ${ true }::jsonb (#84).
Activity