go-gorm / go-gorm/datatypes

Getting issues while using JSONSlice for Postgres []

Open
#266 3 comments 0 reactions 1 assignee Claimed by @jinzhu View on GitHub
Dominant language
Go
Stars
831
Forks
124
PR merge metrics
No merged PRs in 30d

Description

## 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.