Multiple database queries for getSession()

I'm using better-auth with an existing Kysely instance. It's all working ok, but I've noticed that each time I call auth.api.getSession() it's doing 2 queries, one to get the session and then one to get the user. Shouldn't it be using a join to get all the info in a single query?
2 Replies
bekacru
bekacru15h ago
the adapters doesn't support join at the moment. With cookie cache this shouldn't be a big problem but we're working on supporting joins and transactions soon.
Stuart B
Stuart BOP15h ago
Im passing a kysely instance, which I thought wasn't using an adapter? If I just pass a dialect, are joins supported then?

Did you find this page helpful?