electric-sql / pglite

Lightweight WASM Postgres with real-time, reactive bindings.
https://pglite.dev
Apache License 2.0
9.46k stars 204 forks source link

Unable to set null value, query fails with `inconsistent type deduced for parameter` #338

Closed ackava closed 1 month ago

ackava commented 1 month ago

It seems none of the types can be set except int and char through parameters. All the following queries fail with inconsistent type deduced for parameter.


   pg.sql `create table mb( id bigint, updated timestamp null, primary key(id) )`;

   const mb = { id: 1, updated: null };

   pg.sql `insert into mb(id, updated) values (${mb.id}, ${mb.updated})`;

   pg.sql `create table mb( id varchar(200), updated bigint null, primary key(id) )`;

   const mb = { id: "1", updated: null };

   pg.sql `insert into mb(id, updated) values (${mb.id}, ${mb.updated})`;

   pg.sql `create table mb( id varchar(200), updated bigint null, primary key(id) )`;

   const mb = { id: "1", updated: 5 };

   pg.sql `insert into mb(id, updated) values (${mb.id}, ${mb.updated})`;