UserStore.ts overview

Drizzle UserStore and the batched user reads, over a dialect’s Tables or a defineSchema mapping. get is None on a miss and never reads password_hash.


Exports Grouped by Category


utils

GetUser (class)

Read one user by id. Resolves to None on a miss, exactly like UserStore.get. Issue it with Requests.getUser(id).

Signature

declare class GetUser

Source

UserRequest (type alias)

Every request served by makeResolver.

Signature

type UserRequest = GetUser

Source

layer

UserStore backed by drizzle, on top of DrizzleDatabase.

Signature

declare const layer: (schema?: SchemaInput) => Layer.Layer<Auth.UserStore.UserStore, never, DrizzleDatabase>

Source

make

Build a UserStore over the ambient DrizzleDatabase.

Signature

declare const make: (
  schema?: SchemaInput
) => Effect.Effect<typeof Auth.UserStore.UserStore.Service, never, DrizzleDatabase>

Source

makeResolver

A resolver that collapses every GetUser in a batch into a single WHERE id IN (...) query.

Duplicate ids inside the batch are de-duplicated before the query is built.

The returned resolver must be shared for batching to happen — requests are grouped per resolver instance. Build it once behind Requests.AuthRequests/Requests.layer rather than per call site.

Signature

declare const makeResolver: (
  schema?: SchemaInput
) => Effect.Effect<RequestResolver.RequestResolver<UserRequest>, never, DrizzleDatabase>

Source

userFromRow

Row → Auth.Types.User. A promoted column is the sole authority for its attribute: it replaces any value the jsonb bag holds under the same key, and a NULL column leaves the key absent.

Signature

declare const userFromRow: (users: UserSchema) => (row: UserRow) => Auth.Types.User

Source


This site uses Just the Docs, a documentation theme for Jekyll.