Open nikhilro opened 6 months ago
Hey, not an issue since I solved it but think others might run into this.
I was trying to access the Postgres error for a foreign key constraint violation. I wasn't sure of the schema. So, I thought to print it but nothing worked:
console.log( Object.keys(e), Object.getOwnPropertyNames(e), Object.getOwnPropertyDescriptors(e), Reflect.ownKeys(e), )
These all outputted: [ 'stack', 'query', 'parameters', 'args', 'types' ].
[ 'stack', 'query', 'parameters', 'args', 'types' ]
Ultimately looking at the type helped: https://github.com/porsager/postgres/blob/6f20a4820c683b33e7670b606d8daf5670f4b973/types/index.d.ts#L201
Hey, not an issue since I solved it but think others might run into this.
I was trying to access the Postgres error for a foreign key constraint violation. I wasn't sure of the schema. So, I thought to print it but nothing worked:
These all outputted:
[ 'stack', 'query', 'parameters', 'args', 'types' ]
.Ultimately looking at the type helped: https://github.com/porsager/postgres/blob/6f20a4820c683b33e7670b606d8daf5670f4b973/types/index.d.ts#L201