tusken
tusken copied to clipboard
Support spreading a row into a selection mapping
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