belongs to Maven artifact androidx.sqlite:sqlite:2.0.0-alpha1

SupportSQLiteQueryBuilder

public final class SupportSQLiteQueryBuilder
extends Object

java.lang.Object
   ↳ androidx.sqlite.db.SupportSQLiteQueryBuilder


A simple query builder to create SQL SELECT queries.

Summary

Public methods

static SupportSQLiteQueryBuilder builder(String tableName)

Creates a query for the given table name.

SupportSQLiteQueryBuilder columns(String[] columns)

Sets the given list of columns as the columns that will be returned.

SupportSQLiteQuery create()

Creates the SupportSQLiteQuery that can be passed into SupportSQLiteDatabase.query(SupportSQLiteQuery).

SupportSQLiteQueryBuilder distinct()

Adds DISTINCT keyword to the query.

SupportSQLiteQueryBuilder groupBy(String groupBy)

Adds a GROUP BY statement.

SupportSQLiteQueryBuilder having(String having)

Adds a HAVING statement.

SupportSQLiteQueryBuilder limit(String limit)

Adds a LIMIT statement.

SupportSQLiteQueryBuilder orderBy(String orderBy)

Adds an ORDER BY statement.

SupportSQLiteQueryBuilder selection(String selection, Object[] bindArgs)

Sets the arguments for the WHERE clause.

Inherited methods

Public methods

builder

SupportSQLiteQueryBuilder builder (String tableName)

Creates a query for the given table name.

Parameters
tableName String: The table name(s) to query.

Returns
SupportSQLiteQueryBuilder A builder to create a query.

columns

SupportSQLiteQueryBuilder columns (String[] columns)

Sets the given list of columns as the columns that will be returned.

Parameters
columns String: The list of column names that should be returned.

Returns
SupportSQLiteQueryBuilder this

create

SupportSQLiteQuery create ()

Creates the SupportSQLiteQuery that can be passed into SupportSQLiteDatabase.query(SupportSQLiteQuery).

Returns
SupportSQLiteQuery a new query

distinct

SupportSQLiteQueryBuilder distinct ()

Adds DISTINCT keyword to the query.

Returns
SupportSQLiteQueryBuilder this

groupBy

SupportSQLiteQueryBuilder groupBy (String groupBy)

Adds a GROUP BY statement.

Parameters
groupBy String: The value of the GROUP BY statement.

Returns
SupportSQLiteQueryBuilder this

having

SupportSQLiteQueryBuilder having (String having)

Adds a HAVING statement. You must also provide groupBy(String) for this to work.

Parameters
having String: The having clause.

Returns
SupportSQLiteQueryBuilder this

limit

SupportSQLiteQueryBuilder limit (String limit)

Adds a LIMIT statement.

Parameters
limit String: The limit value.

Returns
SupportSQLiteQueryBuilder this

orderBy

SupportSQLiteQueryBuilder orderBy (String orderBy)

Adds an ORDER BY statement.

Parameters
orderBy String: The order clause.

Returns
SupportSQLiteQueryBuilder this

selection

SupportSQLiteQueryBuilder selection (String selection, 
                Object[] bindArgs)

Sets the arguments for the WHERE clause.

Parameters
selection String: The list of selection columns

bindArgs Object: The list of bind arguments to match against these columns

Returns
SupportSQLiteQueryBuilder this