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
Using postgres({types: {bigint: postgres.BigInt}}) I am able to read both int8 and int8[] values as bigints.
I can also input values using string[] parameters for the latter.
However, I get a failure when attempting to use a bigint[] as a parameter.
awaitsql`CREATE TABLE foo(big int8, bigs int8[])`;awaitsql`INSERT INTO foo ${sql({big: 9007199254740993n})}`;expect((awaitsql`SELECT * FROM foo`)[0]).toEqual({big: 9007199254740993n,bigs: null,});awaitsql`INSERT INTO foo ${sql({bigs: ['9007199254740993']})}`;expect((awaitsql`SELECT * FROM foo`)[1]).toEqual({big: null,bigs: [9007199254740993n],});// Fails with:// PostgresError: column "bigs" is of type bigint[] but expression is of type bigintawaitsql`INSERT INTO foo ${sql({bigs: [9007199254740994n]})}`;expect((awaitsql`SELECT * FROM foo`)[2]).toEqual({big: null,bigs: [9007199254740994n],});
Is there something more that I have to configure to be able to input bigint[] parameters?
Thank you for your help!
The text was updated successfully, but these errors were encountered:
Using
postgres({types: {bigint: postgres.BigInt}})
I am able to read bothint8
andint8[]
values asbigint
s.I can also input values using
string[]
parameters for the latter.However, I get a failure when attempting to use a
bigint[]
as a parameter.Is there something more that I have to configure to be able to input
bigint[]
parameters?Thank you for your help!
The text was updated successfully, but these errors were encountered: