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 write fail #38

Closed
skyien opened this issue Apr 24, 2018 · 0 comments · Fixed by vapor/postgres-kit#66
Closed

jsonb write fail #38

skyien opened this issue Apr 24, 2018 · 0 comments · Fixed by vapor/postgres-kit#66
Labels
bug Something isn't working

Comments

@skyien
Copy link

skyien commented Apr 24, 2018

class TasksContainer: Codable, PostgreSQLJSONType  {
    var id: String
    var tasks: [String]
    init(id: String, tasks: [String]) {
        self.id = id
        self.tasks = tasks
    }
}
final class User: PostgreSQLStringModel {
...
var tasks: [TasksContainer]
...
}

On save I have this error "{"error":true,"reason":"ERROR: column "tasks" is of type jsonb but expression is of type jsonb[]"}"

json looks like below
"tasks":[{"id":"04242018","tasks":["one","two"]},{"id":"04242018","tasks":["three","four"]}]

If i change type to jsonb[] i have this error {"error":true,"reason":"ERROR: unsupported jsonb version number 123"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants