Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

PgSelectQueryBuilder

abstract
abstract class PgSelectQueryBuilder<THKT extends PgSelectHKTBase, TTableName extends string | undefined, TSelection, TSelectMode extends SelectMode, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, "not-null"> : {}> extends QueryBuilder<BuildSubquerySelection<TSelection, TNullabilityMap>> {
constructor(
table: PgSelectConfig["table"],
fields: PgSelectConfig["fields"],
fieldsList: PgSelectConfig["fieldsList"],
isPartialSelect: boolean,
session: PgSession | undefined,
dialect: PgDialect,
withList: Subquery[],
);
private createJoin;
private isPartialSelect;
private tableName;
protected config: PgSelectConfig;
protected dialect: PgDialect;
protected joinsNotNullableMap: Record<string, boolean>;
protected session: PgSession | undefined;
readonly _: {
readonly selectMode: TSelectMode;
readonly selection: TSelection;
readonly selectedFields: BuildSubquerySelection<TSelection, TNullabilityMap>;
}
;
fullJoin: JoinFn<THKT, TTableName, TSelectMode, "full", TSelection, TNullabilityMap>;
innerJoin: JoinFn<THKT, TTableName, TSelectMode, "inner", TSelection, TNullabilityMap>;
leftJoin: JoinFn<THKT, TTableName, TSelectMode, "left", TSelection, TNullabilityMap>;
rightJoin: JoinFn<THKT, TTableName, TSelectMode, "right", TSelection, TNullabilityMap>;
 
as<TAlias extends string>(alias: TAlias): SubqueryWithSelection<BuildSubquerySelection<TSelection, TNullabilityMap>, TAlias>;
for(strength: LockStrength, config?: LockConfig): this;
groupBy(builder: (aliases: TSelection) => ValueOrArray<AnyPgColumn | SQL | SQL.Aliased>): this;
groupBy(...columns: (AnyPgColumn | SQL | SQL.Aliased)[]): this;
having(having: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this;
limit(limit: number): this;
offset(offset: number): this;
orderBy(builder: (aliases: TSelection) => ValueOrArray<AnyPgColumn | SQL | SQL.Aliased>): this;
orderBy(...columns: (AnyPgColumn | SQL | SQL.Aliased)[]): this;
toSQL(): Simplify<Omit<Query, "typings">>;
where(where: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this;
}

§Type Parameters

§
TTableName extends string | undefined
[src]
§
TSelection
[src]
§
TSelectMode extends SelectMode
[src]
§
TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, "not-null"> : {}
[src]

§Extends

§
QueryBuilder<BuildSubquerySelection<TSelection, TNullabilityMap>>
[src]

§Constructors

§
new PgSelectQueryBuilder(table: PgSelectConfig["table"], fields: PgSelectConfig["fields"], fieldsList: PgSelectConfig["fieldsList"], isPartialSelect: boolean, session: PgSession | undefined, dialect: PgDialect, withList: Subquery[])
[src]

§Properties

§
createJoin
[src]
§
isPartialSelect
[src]
§
tableName
[src]
§
joinsNotNullableMap: Record<string, boolean>
[src]
§
session: PgSession | undefined
[src]
§
_: {
readonly selectMode: TSelectMode;
readonly selection: TSelection;
readonly selectedFields: BuildSubquerySelection<TSelection, TNullabilityMap>;
}
[src]
§
fullJoin: JoinFn<THKT, TTableName, TSelectMode, "full", TSelection, TNullabilityMap>
[src]
§
innerJoin: JoinFn<THKT, TTableName, TSelectMode, "inner", TSelection, TNullabilityMap>
[src]
§
leftJoin: JoinFn<THKT, TTableName, TSelectMode, "left", TSelection, TNullabilityMap>
[src]
§
rightJoin: JoinFn<THKT, TTableName, TSelectMode, "right", TSelection, TNullabilityMap>
[src]

§Methods

§
as<TAlias extends string>(alias: TAlias): SubqueryWithSelection<BuildSubquerySelection<TSelection, TNullabilityMap>, TAlias>
[src]
§
for(strength: LockStrength, config?: LockConfig): this
[src]
§
groupBy(builder: (aliases: TSelection) => ValueOrArray<AnyPgColumn | SQL | SQL.Aliased>): this
[src]
groupBy(...columns: (AnyPgColumn | SQL | SQL.Aliased)[]): this
[src]
§
having(having: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this
[src]
§
limit(limit: number): this
[src]
§
offset(offset: number): this
[src]
§
orderBy(builder: (aliases: TSelection) => ValueOrArray<AnyPgColumn | SQL | SQL.Aliased>): this
[src]
orderBy(...columns: (AnyPgColumn | SQL | SQL.Aliased)[]): this
[src]
§
toSQL(): Simplify<Omit<Query, "typings">>
[src]
§
where(where: ((aliases: TSelection) => SQL | undefined) | SQL | undefined): this
[src]