Skip to content

Setting<Row>: Closure requires explicit generic type parameter to resolve Row type. #96

@lukevanin

Description

@lukevanin

Currently it is necessary to specify the Row when writing the Setting clause:

let updateStatement = sql { schema in
    let person = schema.into(Person.self)
    Update(person)
    Setting<Person> { row in
        row.age = 42
    }
    Where(
        person.id == 'fred'
    )
}

The Row is already specified in the Update clause so specifying it again is redundant. However it is currently necessary to specify the Row as the Setting clause requires information about which Row is being used, but does not refer to the Row type anywhere.

It would be preferable to be able to omit the Row:

let updateStatement = sql { schema in
    let person = schema.into(Person.self)
    Update(person)
    Setting { row in
        row.age = 42
    }
    Where(
        person.id == 'fred'
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions