tusken icon indicating copy to clipboard operation
tusken copied to clipboard

Support spreading a row into a selection mapping

Open aleclarson opened this issue 3 years ago • 0 comments

db.select(
  t.tweet(tweet => ({
    ...tweet,
    author: db.get(t.user, tweet.author),
  }))
)

By spreading tweet into the mapping, all columns should be selected and an additional author column is added (which overrides the tweet.author column).

Implementing this should be straight-forward.
Just need to define the ownKeys trap on the proxy handler that tweet uses. https://github.com/alloc/tusken/blob/96b4ddd24e30ae5f55936f29ade1556319b66924/src/database/selector.ts#L17

aleclarson avatar Sep 05 '22 16:09 aleclarson