-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Description
Most primitives are successfully serializable into JSON columns, but boolean
appears to be the exception.
await db`CREATE TABLE foo(value JSON)`;
for (const value of ['string-value', 123, true]) {
await db`INSERT INTO foo (value) VALUES (${value})`;
}
// Result: PostgresError: column "value" is of type json but expression is of type boolean
The string
and number
values are successfully serialized with the JSON type converter, but the boolean
is not.
Is it possible that the inferType method is preventing the boolean value from being treated as a JSON value?
Unfortunately I don't understand the type handling code well enough to offer a solution.
Any help is much appreciated! π
Metadata
Metadata
Assignees
Labels
No labels