stringified-select-statement overview

Represents a select statement that was built from a raw string.

Added in v2.0.0

Table of contents
  1. stringified-select-statement overview
  2. utils
    1. AliasedStringifiedSelectStatement (class)
      1. join (property)
      2. commaJoin (property)
      3. apply (property)
      4. as (property)
    2. StringifiedSelectStatement (class)
      1. selectStar (property)
      2. select (property)
      3. apply (property)
      4. as (property)
      5. stringify (property)

utils

AliasedStringifiedSelectStatement (class)

Signature

export declare class AliasedStringifiedSelectStatement<Selection, Alias, Scope, FlatScope>

Added in v2.0.0

join (property)

Signature

join: <
  Selection2 extends string = never,
  Alias2 extends string = never,
  Scope2 extends ScopeShape = never,
  FlatScope2 extends string = never
>(
  operator: string,
  _: ValidAliasInSelection<
    Joinable<Selection2, Alias2, Scope2, FlatScope2>,
    Alias2
  >
) =>
  JoinedFactory<
    { [key in Alias]: Selection } & { [key in Alias2]: Selection2 },
    Extract<Selection, Selection2>
  >;

Added in v2.0.0

commaJoin (property)

Signature

commaJoin: <
  Selection2 extends string = never,
  Alias2 extends string = never,
  Scope2 extends ScopeShape = never,
  FlatScope2 extends string = never
>(
  _: ValidAliasInSelection<
    Joinable<Selection2, Alias2, Scope2, FlatScope2>,
    Alias2
  >
) =>
  Joined<
    never,
    never,
    { [key in Alias]: Selection } & { [key in Alias2]: Selection2 },
    Selection | Selection2
  >;

Added in v2.0.0

apply (property)

Signature

apply: <Ret extends TableOrSubquery<any, any, any, any> = never>(
  fn: (it: this) => Ret
) => Ret;

Added in v2.0.0

as (property)

Signature

as: <NewAlias extends string = never>(as: NewAlias) =>
  AliasedStringifiedSelectStatement<Selection, NewAlias, Scope, FlatScope>;

Added in v2.0.0

StringifiedSelectStatement (class)

Represents a select statement that was built from a raw string.

Signature

export declare class StringifiedSelectStatement<
  Selection,
  Alias,
  Scope,
  FlatScope
> {
  protected constructor(
    /* @internal */
    public __props: {
      readonly content: SafeString;
      readonly scope: ScopeStorage;
      readonly alias?: string;
    }
  );
}

Added in v2.0.0

selectStar (property)

Signature

selectStar: () =>
  SelectStatement<Selection, never, { [key in Alias]: Selection }, Selection>;

Added in v2.0.0

select (property)

Signature

select: <
  NewSelection extends string = never,
  SubSelection extends Selection = never
>(
  _:
    | readonly SubSelection[]
    | ((
        fields: Record<Selection, SafeString> &
          SelectionOfScope<{ [key in Alias]: Selection }> &
          NoSelectFieldsCompileError
      ) => Record<NewSelection, SafeString>)
) =>
  SelectStatement<
    NewSelection | SubSelection,
    never,
    { [key in Alias]: Selection },
    Selection
  >;

Added in v2.0.0

apply (property)

Signature

apply: <Ret extends TableOrSubquery<any, any, any, any> = never>(
  fn: (it: this) => Ret
) => Ret;

Added in v2.0.0

as (property)

Signature

as: <NewAlias extends string = never>(as: NewAlias) =>
  AliasedStringifiedSelectStatement<Selection, NewAlias, Scope, FlatScope>;

Added in v2.0.0

stringify (property)

Signature

stringify: () => string;

Added in v2.0.0