TanStack / TanStack/db

Add generic expression helpers to help collection implementors handle ASTs

Open
#799 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.9k
Forks
266
Avg merge
1d 4h
Merged PRs (30d)
55

Description

We recently added some expression handlers to simplify the handling of ASTs which is needed when handling pushed down predicates in collection implementations. However, the current helpers only help with simple expressions and break the moment you expression is more complex (involves not, or, ...).

I've worked a lot with ASTs before (in particular i was using ScalaMeta) and it has some very useful helper functions to do:

  • AST traversals
  • AST transforms
  • AST collectors

They are basically the foreach, map and reduce of ASTs. It would be useful to implement those helpers as they will empower users to handle any AST. There are some good examples that show how to use these helpers on ASTs: https://scalameta.org/docs/trees/guide.html#traverse-trees

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing expression handlers used for pushed-down predicates and the collection implementation entry points; no specific files or tests are named in the issue. Compare the requested traversal, transform, and collector behavior with the linked ScalaMeta guide, then define the helper API and add coverage for simple and compound expressions such as not and or.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.