Skip to content

Discussion: get_many getters are impractical #7

@OtaK

Description

@OtaK

Hey!

I've been trying to work with the get_many getters lately and they're essentially useless IMO because:

  • They take a single argument and perform a = test on it in the SQL query
  • They will return a single row in cases you're searching something like a UNIQUE index.

Meaning that you will have to resort to manual SQL queries if you're doing something as trivial as looking multiple records by a batched id/unique key.

I suggest changing the query in get_many to use a IN() statement instead of = and accepting a slice of arguments instead of a single one as it would semantically work as well.

But of course, as it'd be a breaking change, I'm triggering a discussion here.

I can take care of the implementation.

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