common-table-expression overview

Added in v2.0.0

Table of contents
  1. common-table-expression overview
  2. utils
    1. CommonTableExpressionFactory (class)
      1. with_ (property)
      2. withR (property)
      3. do (property)

utils

CommonTableExpressionFactory (class)

Signature

export declare class CommonTableExpressionFactory<
  Selection,
  Alias,
  Scope,
  FlatScope
> {
  private constructor(
    /* @internal */
    public __props: {
      readonly ctes: ReadonlyArray<CTE>;
    }
  );
}

Added in v2.0.0

with_ (property)

Signature

with_: <NSelection extends string, NAlias extends string>(
  select: (acc: {
    [K in keyof Scope]: Table<
      Scope[K],
      never,
      { [k in K]: Scope[K] },
      Scope[K]
    >;
  }) => AliasedSelectStatement<NSelection, NAlias, any, any>
) =>
  CommonTableExpressionFactory<
    Selection,
    Alias,
    Scope & { [key in NAlias]: NSelection },
    FlatScope | NSelection
  >;

Added in v2.0.0

withR (property)

Signature

withR: <NSelection extends string, NAlias extends string>(
  select: (acc: {
    [K in keyof Scope]: Table<
      Scope[K],
      never,
      { [k in K]: Scope[K] },
      Scope[K]
    >;
  }) => AliasedSelectStatement<any, NAlias, any, any>,
  columns: readonly NSelection[]
) =>
  CommonTableExpressionFactory<
    Selection,
    Alias,
    Scope & { [key in NAlias]: NSelection },
    FlatScope | NSelection
  >;

Added in v2.0.0

do (property)

Signature

do: <NSelection extends string, NAlias extends string, NScope extends ScopeShape, NFlatScope extends string>(_: (acc: { [K in keyof Scope]: Table<Scope[K], never, { [k in K]: Scope[K]; }, Scope[K]>; }) => SelectStatement<NSelection, NAlias, NScope, NFlatScope>) => SelectStatement<NSelection, NAlias, NScope, NFlatScope>

Added in v2.0.0