Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONB is not nullable #638

Closed
benjaminjb opened this issue Apr 12, 2021 · 0 comments
Closed

JSONB is not nullable #638

benjaminjb opened this issue Apr 12, 2021 · 0 comments

Comments

@benjaminjb
Copy link

Description

Feature request: a nullable JSONB field.

slices.Map does not handle a nullable JSONB field. gobuffalo/nulls has replacements for the built-in null types in the sql package, but since jsonb is not a sql native type, there is no null handling in that package.

(I have a fix that I am experimenting with locally, so will create a PR and link to that in a moment.)

Steps to Reproduce the Problem

  1. Add a fizz migration with a nullable jsonb field: add_column("table", "column", "jsonb", {"null": true})
  2. Attempt to retrieve an object from that table. (In my case, I'm using Insomnia to call to the api.)

Expected Behavior

The JSONB field to be marshalled as a null object.

Actual Behavior

Error from API:

"error": "scan source was not []byte nor string but <nil>"

Info

Pop (through Buffalo): github.com/gobuffalo/pop/v5@v5.3.3
Go: go1.16.2 darwin/amd64
MacOS: 10.14.6 (18G6032)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant