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

Can't save empty array #80

Closed
MihaelIsaev opened this issue Jun 19, 2018 · 2 comments
Closed

Can't save empty array #80

MihaelIsaev opened this issue Jun 19, 2018 · 2 comments
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@MihaelIsaev
Copy link
Member

I have a Fluent model

final class Experiment: Content {
    var id: UUID?
    var tags: [String]?
}

When I'm trying to save it

Experiment(tags: ["test"]).save(on: conn) // works
Experiment(tags: nil).save(on: conn) // works
Experiment(tags: []).save(on: conn) // throws error

error is

⚠️ [PostgreSQLError.server.error.array_recv: wrong element type]

It worked before update to the latest Fluent/PostgreSQL release with a lot of changes.
So it seems like a bug, cause saving empty array is not a crime 🤔

@tanner0101 tanner0101 added this to the 1.0.0 milestone Jun 19, 2018
@tanner0101 tanner0101 added the bug Something isn't working label Jun 19, 2018
@tanner0101 tanner0101 self-assigned this Jun 19, 2018
@tanner0101
Copy link
Member

Fixed in #79, thanks for reporting!

@Jinxiansen
Copy link
Member

Hi, brother, I have used MySQLModel, also have this problem, do not know when to solve the release version?

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
No open projects
Vapor 3
  
Awaiting triage
Development

No branches or pull requests

3 participants