-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Using JSON type in Postgres #133
Comments
Use type Address struct {
Home string
Work string
}
type Person struct {
Id int `db:"id"`
Address types.JsonText `db:"address"`
}
|
Thanks. It solved the problem. |
Anyone having issues using |
How could this be used when not taking the time to create matching structs for every database table?
This works nicely, but garbles the returned JSON columns as base64-encoded.
|
You should be using this instead:
it's |
Rahmat |
Hi,
I'm trying to use JSON data type in Postgres. It works properly and the data is correctly inserted to the database. However when selecting multiple rows from the database, all the JSON data belongs to the last row. For example, the output of the following code:
is:
while in psql, the data is:
Am I missing something or is this a bug?
The text was updated successfully, but these errors were encountered: