Skip to content

Query constructor #111

@moigagoo

Description

@moigagoo

Norm's select procs work with vanilla WHERE conditions, which you have to write manually. The problem is you have to know which table and column names correspond to which type and attribute names. This is error-prone, fragile in the long run, and all together ugly.

We need a query constructor that would allow the programmer to compose queries in terms of Nim types and object fields.

Instead of db.select(pets, """"Pet".species LIKE $1""", "dog"), I want something like db.select(pets, qry(Pet.species ~ "$1"), "dog") or db.select(pets, qry(Pet.species.like "$1"), "dog") or even db.select(pets, qry(Pet.species ~ "dog"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions