Skip to content

Misleading error message when = is used instead of := #91

@liufengyun

Description

@liufengyun

I am using named tuples in a project, it works nicely, great work 👍

However, I encountered a usability problem: a silly mistake that took me some time to debug.

Given a model that works well:

case class City(id: Int, name: String)

City.insert.columns(_.name := "Lausanne").returning(_.id).single

When I add a new field rating and update the query with a mistake (used = instead of :=):

case class City(id: Int, name: String, rating: Int)

City.insert.columns(_.name := "Lausanne", _.rating = 3).returning(_.id).single

The compiler complains that:

value rating is not a member of scalasql.namedtuples.SimpleTable.Record[City, scalasql.query.Column]

However, the field is there. It would be nice to avoid the misleading message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions