I’m working on a project, and using Knex for it, (though if you give me raw SQL I’m pretty sure I can convert that as well.) So, here’s the sitch. I have tables ‘group’ and ‘user_group’. table ‘…
Tag: knex.js
Knex query returning bool logic
I am writing some knex queries to check if a supplied code otherwise known as a voucher is legitimate under 4 constraints. The voucher exists The voucher has not expired The voucher is for the …
knex postgres join as nested JSON
I’m using knex with postgresql db, I have a row in table A which has one-to-one relation to rows in table B and one-to-many relation to rows in table C. I wanna join a row from A with B and C and get a json like Where stuff like aCol means column from table A, bCol – column from table