Options
All
  • Public
  • Public/Protected
  • All
Menu

Type Parameters

  • T

Hierarchy

  • default<T>
    • SupabaseQueryBuilder

Index

Constructors

  • new SupabaseQueryBuilder<T>(url: string, __namedParameters: { fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>); headers?: GenericObject; realtime: RealtimeClient; schema: string; shouldThrowOnError?: boolean; table: string }): SupabaseQueryBuilder<T>
  • Type Parameters

    • T

    Parameters

    • url: string
    • __namedParameters: { fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>); headers?: GenericObject; realtime: RealtimeClient; schema: string; shouldThrowOnError?: boolean; table: string }
      • Optional fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)
          • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
          • Parameters

            • input: RequestInfo | URL
            • Optional init: RequestInit

            Returns Promise<Response>

      • Optional headers?: GenericObject
      • realtime: RealtimeClient
      • schema: string
      • Optional shouldThrowOnError?: boolean
      • table: string

    Returns SupabaseQueryBuilder<T>

Properties

_headers: GenericObject
_realtime: RealtimeClient
_schema: string
_subscription: null | SupabaseRealtimeClient = null
_table: string
allowEmpty: boolean
body?: Partial<T> | Partial<T>[]
fetch: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)

Type declaration

    • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

headers: {}

Type declaration

  • [key: string]: string
method: "GET" | "POST" | "PATCH" | "DELETE" | "HEAD"
schema?: string
shouldThrowOnError: boolean
signal?: AbortSignal
url: URL

Methods

  • delete(__namedParameters?: { count?: null | "exact" | "planned" | "estimated"; returning?: "minimal" | "representation" }): default<T>
  • Performs a DELETE on the table.

    Parameters

    • Optional __namedParameters: { count?: null | "exact" | "planned" | "estimated"; returning?: "minimal" | "representation" }
      • Optional count?: null | "exact" | "planned" | "estimated"
      • Optional returning?: "minimal" | "representation"

    Returns default<T>

  • insert(values: Partial<T> | Partial<T>[], options?: { count?: null | "exact" | "planned" | "estimated"; returning?: "minimal" | "representation" }): default<T>
  • insert(values: Partial<T> | Partial<T>[], options?: { count?: null | "exact" | "planned" | "estimated"; onConflict?: string; returning?: "minimal" | "representation"; upsert?: boolean }): default<T>
  • Performs an INSERT into the table.

    Parameters

    • values: Partial<T> | Partial<T>[]

      The values to insert.

    • Optional options: { count?: null | "exact" | "planned" | "estimated"; returning?: "minimal" | "representation" }
      • Optional count?: null | "exact" | "planned" | "estimated"
      • Optional returning?: "minimal" | "representation"

    Returns default<T>

  • deprecated

    Use upsert() instead.

    Parameters

    • values: Partial<T> | Partial<T>[]
    • Optional options: { count?: null | "exact" | "planned" | "estimated"; onConflict?: string; returning?: "minimal" | "representation"; upsert?: boolean }
      • Optional count?: null | "exact" | "planned" | "estimated"
      • Optional onConflict?: string
      • Optional returning?: "minimal" | "representation"
      • Optional upsert?: boolean

    Returns default<T>

  • select(columns?: string, __namedParameters?: { count?: null | "exact" | "planned" | "estimated"; head?: boolean }): default<T>
  • Performs vertical filtering with SELECT.

    Parameters

    • Optional columns: string

      The columns to retrieve, separated by commas.

    • Optional __namedParameters: { count?: null | "exact" | "planned" | "estimated"; head?: boolean }
      • Optional count?: null | "exact" | "planned" | "estimated"
      • Optional head?: boolean

    Returns default<T>

  • then<TResult1, TResult2>(onfulfilled?: null | ((value: PostgrestResponse<T>) => TResult1 | PromiseLike<TResult1>), onrejected?: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)): PromiseLike<TResult1 | TResult2>
  • Type Parameters

    Parameters

    • Optional onfulfilled: null | ((value: PostgrestResponse<T>) => TResult1 | PromiseLike<TResult1>)
    • Optional onrejected: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)

    Returns PromiseLike<TResult1 | TResult2>

  • If there's an error with the query, throwOnError will reject the promise by throwing the error instead of returning it as part of a successful response.

    Parameters

    • Optional throwOnError: boolean

    Returns SupabaseQueryBuilder<T>

  • update(values: Partial<T>, __namedParameters?: { count?: null | "exact" | "planned" | "estimated"; returning?: "minimal" | "representation" }): default<T>
  • Performs an UPDATE on the table.

    Parameters

    • values: Partial<T>

      The values to update.

    • Optional __namedParameters: { count?: null | "exact" | "planned" | "estimated"; returning?: "minimal" | "representation" }
      • Optional count?: null | "exact" | "planned" | "estimated"
      • Optional returning?: "minimal" | "representation"

    Returns default<T>

  • upsert(values: Partial<T> | Partial<T>[], __namedParameters?: { count?: null | "exact" | "planned" | "estimated"; ignoreDuplicates?: boolean; onConflict?: string; returning?: "minimal" | "representation" }): default<T>
  • Performs an UPSERT into the table.

    Parameters

    • values: Partial<T> | Partial<T>[]

      The values to insert.

    • Optional __namedParameters: { count?: null | "exact" | "planned" | "estimated"; ignoreDuplicates?: boolean; onConflict?: string; returning?: "minimal" | "representation" }
      • Optional count?: null | "exact" | "planned" | "estimated"
      • Optional ignoreDuplicates?: boolean
      • Optional onConflict?: string
      • Optional returning?: "minimal" | "representation"

    Returns default<T>

Generated using TypeDoc