Notr Logo
API Reference

Types

Shared types used across Drizzleasy.

TResult

type TResult<T> = {
  data?: T
  error?: Error
}

TEntity

type TEntity = {
  id: string | number
  createdAt?: string | Date
  updatedAt?: string | Date
}

TCreateInput / TUpdateInput

type TCreateInput<T extends TEntity> = Omit<T, 'id' | 'createdAt' | 'updatedAt'>

type TUpdateInput<T extends TEntity> = Partial<Omit<T, 'id' | 'createdAt'>>

WHERE types

type TWhereClause<T> = {
  [K in keyof T]?:
    | T[K]
    | T[K][]
    | (T[K] extends number | string | Date ? `>${string}` | `>=${string}` | `<${string}` | `<=${string}` | `!${string}` : never)
    | (T[K] extends string ? `*${string}*` | `${string}*` | `*${string}` : never)
}