I am getting errors when trying to insert new records into my database (Postgres) using Node.js with Objection.js as the ORM/db handler. I have followed the tutorial, but I cannot find a mention of this in their current docs.
Here are my errors:
When debugging to console: error: null value in column "id" violates not-null constraint
When receiving the error via Postman, e.g. (for searchability with search engines): error: null value in column "id" violates not-null constraint
It looks like the 'id' column is being inserted to with a 'null' value from the logged query; it should not be inserting at all because it uses a default sequence value (auto-identity field, in other SQL solutions).
How do I insert new entities?