Skip to content

Filtering: better "read" fns #120

@Wulf

Description

@Wulf

I just wanted to share my thoughts on the 'read/paginate' functions:

They are very arbitrary unless we introduce a way to filter the results.

In #103, I attempted to add filter() helper which allows us to generate arbitrary WHERE clauses; however, it currently only supports "equals"-based clauses, and not things like:

  • string search
  • date/time start/end/range
  • between/greater-than/less-than number,
  • etc; essentially the full list of SQL operations allowed in WHERE clauses.

This is a major turning point for dsync which has primarily been a code-generation tool as opposed to a query-builder. Deciding to add filter() is the only way functions like read() and paginate() make sense. However, we can only go so far with the filtering before we end up with a query builder 😅.

So here's the thing: do we continue with this effort?

Some more thoughts: we should consider generating cursor-based pagination functions and may also want to split read into: read_first and read_all (or similar-named functions).

Anyway, no big deal, hope all is well 🙌

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