You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
Whenever a schema contains a property of Type.Array(Type.Object()) with PostgreSQL the user may encounter an issue during insert/update. This is related to this issue with pg.
The issue is basically that the parser can't handle a top level array normally. I found the simplest solution is to make sure that the column is of type jsonb[] in the database.
In Knex this is acheived with table.specificType('my_json_array', 'jsonb ARRAY')
The error the user may see if the column is jsonb is something like this
{
"name": "NotFound",
"message": "insert into \"my_json_array\") values ($1) returning \"id\" - invalid input syntax for type json",
"code": 404,
"className": "not-found"
}
Comment/Problem
Whenever a schema contains a property of
Type.Array(Type.Object())
with PostgreSQL the user may encounter an issue during insert/update. This is related to this issue withpg
.The issue is basically that the parser can't handle a top level array normally. I found the simplest solution is to make sure that the column is of type
jsonb[]
in the database.In Knex this is acheived with
table.specificType('my_json_array', 'jsonb ARRAY')
The error the user may see if the column is
jsonb
is something like thisSystem configuration
The text was updated successfully, but these errors were encountered: