Skip to content

Limit on list_<type> has unintuitive behaviour #380

@MortGron

Description

@MortGron

Is your feature request related to a problem? Please describe.
Let ut say A has a property b which is a direct relation to B. Let us also say that the property b points to more than 5 different Bs, but that multiple As might point to the same B.

If you write
client.A.select().b.list_b(limit=5)
you would expect 5 different/unique Bs to be listed, but the current behaviour is that five Bs are retrieved, and since multiple As point to the same B you might end up with fewer than 5 Bs in the result.

Describe the solution you'd like
A new argument to list_b that ensures you limit the result to the specified number of unique results.

Describe alternatives you've considered
If the limit had been in the "select" clause of the query and not in the "with" clause, the intuitive behaviour might be achived.

Additional context
Add any other context or screenshots about the feature request here.

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