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
How can I use JSONSlice for JSON[] fields with gorm, I have used the library but getting an error while inserting the data. The Table model struct is attached below.
The document you expected this should be explained
I am getting issue when the arrays are empty in the database layer.
UTC [268] ERROR: malformed array literal: "null"
postgres-1 | 2024-08-06 15:18:34.167 UTC [268] DETAIL: Array value must start with "{" or dimension information.
Expected answer
The text was updated successfully, but these errors were encountered:
I m not passing any data, that should be valid right, if you see my message carefully, i have mentioned that I passing empty field, shouldn't the library handle that?
@venky-connectwise the JSONSlice now is for JSON type column , It is decode the field value as a slice, not the pg's JSON[] filed type. it's first JSON and then use as slice, it can be
Your Question
How can I use JSONSlice for JSON[] fields with gorm, I have used the library but getting an error while inserting the data. The Table model struct is attached below.
The document you expected this should be explained
https://go.dev/play/p/aEEKW7fUa72
I am getting issue when the arrays are empty in the database layer.
UTC [268] ERROR: malformed array literal: "null"
postgres-1 | 2024-08-06 15:18:34.167 UTC [268] DETAIL: Array value must start with "{" or dimension information.
Expected answer
The text was updated successfully, but these errors were encountered: