export interface QueryParams<T> {
  where?: Partial<{ [K in keyof T]: T[K] | WhereOperators<T[K]> }>
  whereIn?: Partial<{ [K in keyof T]: T[K][] }>
  whereNotIn?: Partial<{ [K in keyof T]: T[K][] }>
  whereNull?: (keyof T)[]
  whereNotNull?: (keyof T)[]
  whereNullOrNotNull?: (keyof T)[]
  select?: (keyof T)[]
  findOne?: boolean
  relations?: string[]
  innerJoinRelations?: string[]
  search?: Partial<T>
  take?: number
  skip?: number
  orderBy?: Partial<Record<keyof T, "ASC" | "DESC">>
  groupBy?: (keyof T)[]
  rawData?: boolean
  relationCount?: string[]
  sum?: string[]
  relationCountWithConditions?: Array<{
    relation: string
    alias: string
    condition?: string
    params?: any
  }>
  orWhere?: Record<string, any>
  whereLower?: Partial<{ [K in keyof T]: T[K] }>
  getCountOnly?: boolean
  withDeleted?: boolean
  distinctValues?: any
}

type WhereOperators<T> = {
  lt?: T
  gt?: T
  lte?: T
  gte?: T
  not?: T
  ilike?: T
}
