Skip to content

Allow update and delete to specify a condition #135

@ajusa

Description

@ajusa

Use case here is pretty common, let's say you've got a comment:

type Comment = ref object of Model
  text: string
  user: string

I'd like to be able to do something like

dbConn.update(comment, "user = ?", signedInUser)

It makes it much easier to ensure that updates are only happening to an item that a user owns/created. Right now I'm doing the checking manually, which results in additional select queries. Something similar already exists for count and sum, as they take additional conditions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Candidates

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions