Insert record in mysql with adonisjs jsonb field #3502
Replies: 4 comments 2 replies
-
Just |
Beta Was this translation helpful? Give feedback.
-
There is https://github.com/watzon/adonis-jsonable, but I think it doesn't work with latest adonis |
Beta Was this translation helpful? Give feedback.
-
Maybe use a raw query? https://docs.adonisjs.com/reference/database/raw-query-builder#document |
Beta Was this translation helpful? Give feedback.
-
Second idea to use custom type parser https://docs.adonisjs.com/cookbooks/using-postgres-custom-type-parsers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to insert a record where one of the fields is of type JSONB
Below is the format I'm trying to build and at the end the error that is being issued.
The field in question is veiculo
orm is trying to access the inside of the json to try to indetify the field.
It should insert the complete object.
I thank the attention. Thanks.
Post
Model
Migration
Error
Error: ER_BAD_FIELD_ERROR: Unknown column 'placa' in 'field list'
Beta Was this translation helpful? Give feedback.
All reactions