Skip to main content
Module

x/drizzle/pg-core.ts>PgSelectQueryBuilder

Deno port of the drizzle-orm library
Latest
class PgSelectQueryBuilder
Re-export
Abstract
import { PgSelectQueryBuilder } from "https://deno.land/x/drizzle@v0.23.85/pg-core.ts";

Constructors

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

Type Parameters

THKT extends PgSelectHKTBase
TTableName extends string | undefined
TSelection
TSelectMode extends SelectMode
optional
TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, "not-null"> : { }

Properties

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>; }

Methods

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