HackerTrans
TopNewTrendsCommentsPastAskShowJobs

evangow

no profile record

comments

evangow
·hace 3 años·discuss
I would love it if the would remove the key from the array.
evangow
·hace 3 años·discuss
2 tables that reference each other and the foreign key columns both have a NOT NULL constraint.
evangow
·hace 3 años·discuss
Since we're here talking about Postgres and SQL standards. Here's my wishlist:

- Support for arrays of foreign keys. This one has been worked on a couple of times but hasn't made it into a release. https://commitfest.postgresql.org/17/1252/ - I think this would be an absolutely phenomenal way of handling sorting, instead of having to use linked lists and CTEs or some type of "order/position" column

- Support for deferring NOT NULL and CHECK constraints to the end of a transaction (just ran into this problem yesterday)

Edit: typos
evangow
·hace 7 años·discuss
I use await-to-js[1] to clean this stuff up. You can pair it with destructuring arrays like so:

const [err, result] = await to(funcThatReturnSomeType());

if(err) doSomethingWithErr(err);

doSomething(result);

[1] https://www.npmjs.com/package/await-to-js