Skip to main content

Class: SqlSelect

Extends

Constructors

new SqlSelect()

new SqlSelect(state: Readonly<SqlSelectState>, binding?: SqlBinding): SqlSelect

Parameters

ParameterType
stateReadonly<SqlSelectState>
binding?SqlBinding

Returns

SqlSelect

Overrides

SqlNode.constructor

Defined in

packages/verse-core/src/db/sql.ts:851

Accessors

binding

get binding(): undefined | SqlBinding

Returns

undefined | SqlBinding

Inherited from

SqlNode.binding

Defined in

packages/verse-core/src/db/sql.ts:102


distinct

get distinct(): undefined | boolean

Returns

undefined | boolean

Defined in

packages/verse-core/src/db/sql.ts:888


from

get from(): undefined | SqlNode

Returns

undefined | SqlNode

Defined in

packages/verse-core/src/db/sql.ts:892


groupBy

get groupBy(): undefined | SqlNode

Returns

undefined | SqlNode

Defined in

packages/verse-core/src/db/sql.ts:951


identifier

get identifier(): SqlIdentifier

Returns

SqlIdentifier

Inherited from

SqlNode.identifier

Defined in

packages/verse-core/src/db/sql.ts:127


joins

get joins(): undefined | List<SqlJoin>

Returns

undefined | List<SqlJoin>

Defined in

packages/verse-core/src/db/sql.ts:904


limit

get limit(): undefined | SqlNode

Returns

undefined | SqlNode

Defined in

packages/verse-core/src/db/sql.ts:955


nullable

get nullable(): undefined | boolean

Returns

undefined | boolean

Inherited from

SqlNode.nullable

Defined in

packages/verse-core/src/db/sql.ts:110


offset

get offset(): undefined | SqlNode

Returns

undefined | SqlNode

Defined in

packages/verse-core/src/db/sql.ts:967


orderBy

get orderBy(): undefined | SqlOrderBy

Returns

undefined | SqlOrderBy

Defined in

packages/verse-core/src/db/sql.ts:939


projection

get projection(): SqlNode

Returns

SqlNode

Defined in

packages/verse-core/src/db/sql.ts:876


readable

get readable(): boolean

Returns

boolean

Inherited from

SqlNode.readable

Defined in

packages/verse-core/src/db/sql.ts:114


size

get size(): number

Returns

number

Inherited from

SqlNode.size

Defined in

packages/verse-core/src/db/sql.ts:155


type

get type(): undefined | SqlType

Returns

undefined | SqlType

Inherited from

SqlNode.type

Defined in

packages/verse-core/src/db/sql.ts:106


where

get where(): undefined | SqlNode

Returns

undefined | SqlNode

Defined in

packages/verse-core/src/db/sql.ts:927

Methods

accept()

accept<T, S>(visitor: SqlVisitor<T, unknown>, state?: S): T

Type Parameters

Type ParameterDefault type
T-
Sunknown

Parameters

ParameterType
visitorSqlVisitor<T, unknown>
state?S

Returns

T

Overrides

SqlNode.accept

Defined in

packages/verse-core/src/db/sql.ts:987


addJoins()

addJoins(...joins: readonly SqlJoin[]): SqlSelect

Parameters

ParameterType
...joinsreadonly SqlJoin[]

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:908


apply()

apply(ctor: Newable<SqlNode>): SqlNode

Parameters

ParameterType
ctorNewable<SqlNode>

Returns

SqlNode

Inherited from

SqlNode.apply

Defined in

packages/verse-core/src/db/sql.ts:147


bind()

bind(binding: SqlBinding): SqlSelect

Parameters

ParameterType
bindingSqlBinding

Returns

SqlSelect

Overrides

SqlNode.bind

Defined in

packages/verse-core/src/db/sql.ts:979


compare()

compare(op: SqlBinaryOperator, other: SqlNode): SqlBinary

Parameters

ParameterType
opSqlBinaryOperator
otherSqlNode

Returns

SqlBinary

Inherited from

SqlNode.compare

Defined in

packages/verse-core/src/db/sql.ts:151


equals()

equals(other: unknown): boolean

True if this and the other Collection have value equality, as defined by Immutable.is().

Note: This is equivalent to Immutable.is(this, other), but provided to allow for chained expressions.

Parameters

ParameterType
otherunknown

Returns

boolean

Overrides

SqlNode.equals

Defined in

packages/verse-core/src/db/sql.ts:1031


hashCode()

hashCode(): number

Computes and returns the hashed identity for this Collection.

The hashCode of a Collection is used to determine potential equality, and is used when adding this to a Set or as a key in a Map, enabling lookup via a different instance.

const { List, Set } = require('immutable');
const a = List([ 1, 2, 3 ]);
const b = List([ 1, 2, 3 ]);
assert.notStrictEqual(a, b); // different instances
const set = Set([ a ]);
assert.equal(set.has(b), true);

Note: hashCode() MUST return a Uint32 number. The easiest way to guarantee this is to return myHash | 0 from a custom implementation.

If two values have the same hashCode, they are not guaranteed to be equal. If two values have different hashCodes, they must not be equal.

Note: hashCode() is not guaranteed to always be called before equals(). Most but not all Immutable.js collections use hash codes to organize their internal data structures, while all Immutable.js collections use equality during lookups.

Returns

number

Overrides

SqlNode.hashCode

Defined in

packages/verse-core/src/db/sql.ts:1047


identify()

identify(aliaser: (n: SqlNode) => SqlNode): SqlNode

Parameters

ParameterType
aliaser(n: SqlNode) => SqlNode

Returns

SqlNode

Overrides

SqlNode.identify

Defined in

packages/verse-core/src/db/sql.ts:983


isAggregate()

isAggregate(): boolean

Returns

boolean

Inherited from

SqlNode.isAggregate

Defined in

packages/verse-core/src/db/sql.ts:159


map()

map(mapper: (node: SqlNode) => SqlNode): SqlNode

Parameters

ParameterType
mapper(node: SqlNode) => SqlNode

Returns

SqlNode

Inherited from

SqlNode.map

Defined in

packages/verse-core/src/db/sql.ts:143


onlyHas()

onlyHas(...clauses: keyof SqlSelectState[]): boolean

Parameters

ParameterType
...clauseskeyof SqlSelectState[]

Returns

boolean

Defined in

packages/verse-core/src/db/sql.ts:858


reduce()

reduce(): List<SqlNode>

Returns

List<SqlNode>

Inherited from

SqlNode.reduce

Defined in

packages/verse-core/src/db/sql.ts:139


rewrite()

rewrite(rewriter: SqlRewriter): SqlNode

Parameters

ParameterType
rewriterSqlRewriter

Returns

SqlNode

Overrides

SqlNode.rewrite

Defined in

packages/verse-core/src/db/sql.ts:991


scope()

scope(_: SqlIdentifier): SqlNode

Parameters

ParameterType
_SqlIdentifier

Returns

SqlNode

Inherited from

SqlNode.scope

Defined in

packages/verse-core/src/db/sql.ts:123


uniquify()

uniquify(_: Set<string>, __: (node: SqlNode) => SqlAlias): SqlNode

Parameters

ParameterType
_Set<string>
__(node: SqlNode) => SqlAlias

Returns

SqlNode

Inherited from

SqlNode.uniquify

Defined in

packages/verse-core/src/db/sql.ts:135


withFrom()

withFrom(from?: SqlNode): SqlSelect

Parameters

ParameterType
from?SqlNode

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:896


withJoins()

withJoins(joins: List<SqlJoin>): SqlSelect

Parameters

ParameterType
joinsList<SqlJoin>

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:919


withLimit()

withLimit(limit: undefined | SqlNode): SqlSelect

Parameters

ParameterType
limitundefined | SqlNode

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:959


withOffset()

withOffset(offset: undefined | SqlNode): SqlSelect

Parameters

ParameterType
offsetundefined | SqlNode

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:971


withOrderBy()

withOrderBy(orderBy: SqlOrderBy): SqlSelect

Parameters

ParameterType
orderBySqlOrderBy

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:943


withProjection()

withProjection(projection: SqlNode): SqlSelect

Parameters

ParameterType
projectionSqlNode

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:880


withWhere()

withWhere(where: undefined | SqlNode): SqlSelect

Parameters

ParameterType
whereundefined | SqlNode

Returns

SqlSelect

Defined in

packages/verse-core/src/db/sql.ts:931