Skip to content

Architecture

Martin Kučera edited this page Jan 3, 2023 · 11 revisions

QueryBuilder

QueryBuilder is the most central class of the whole library. One instance of QueryBuilder represents one query that is being generated. An SQL query consists of clauses, each of which corresponds to one field of the respective QueryBuilder instance: scope (for the SELECT clause), from, where, orderBy, limit, offset.

An instance of QueryBuilder is initialized by calling from(TableName) where TableName is an object that extends Table (for details see Database schema definition).

The most important methods that modify the query are listed below.

map (select)

The map method updates the scope of the query.

filter (where)

The filter method updates the WHERE clause of the query.

sortBy

The sortBy method updates the ORDER BY clause of the query.

Clone this wiki locally