LimitOffsetClause

Description

Interface that specify union of the LIMIT and OFFSET statements.

Its specified in a form one can use limit and offset in this order or viceversa, but not be able to repeat the limit or offset methods.

Example:

  • Correct:

    import { LimitOffsetClause } from "sparqler/clauses";
    let query:LimitOffsetClause;
    
    query
        .limit( /*...*/ )
        .offset( /*...*/ )
    ;
    
    query
        .offset( /*...*/ )
        .limit( /*...*/ )
    ;
    
    query
        .limit( /*...*/ )
    ;
  • Incorrect:

    import { LimitOffsetClause } from "sparqler/Clauses";
    let query:LimitOffsetClause;
    
    query
        .limit( /*...*/ )
        .limit( /*...*/ ) // Not possible
        .offset( /*...*/ )
    ;
    
    query
        .offset( /*...*/ )
        .limit( /*...*/ )
        .offset( /*...*/ ) // Not possible
    ;

LimitOffsetClause

Description

Constant with the utils for LimitOffsetClause objects.

Methods

createFrom<C extends Container<QueryToken<QueryClauseToken> | SubSelectToken>, T extends FinishClause, O extends object>( genericFactory: Factory<C, T>, container: C, object: O ): O & LimitOffsetClause<T>

Factory function that allows to crete a LimitOffsetClause from the object provided.

Parameters

NameTypeDescription
Factory<C, T>

The factory to create the generic finish of the LimitOffsetClause statement.

C

The related container with the data for the LimitOffsetClause statement.

O

The base base from where to create the LimitOffsetClause statement.

Returns

The LimitOffsetClause statement created from the object provided.