get `event` in `/utils/db.js` - Can I be done?
I would like to do something like this:
So then in any route I can do
db.select()
- However useRequestEvent()
is not defined somehow?
I know I can simply pass const db = useDb(event)
on top of each route, I just would like to avoid passing event on every route and hopefully get better types. Should this instead be a plugin? What's the best practice here?1 Reply
Found it: