SupportSQLiteQueryBuilder

class SupportSQLiteQueryBuilder


A simple query builder to create SQL SELECT queries.

Summary

Public companion functions

SupportSQLiteQueryBuilder
builder(tableName: String)

Creates a query for the given table name.

Public functions

SupportSQLiteQueryBuilder
columns(columns: Array<String>?)

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

SupportSQLiteQuery

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

SupportSQLiteQueryBuilder

Adds DISTINCT keyword to the query.

SupportSQLiteQueryBuilder
groupBy(groupBy: String?)

Adds a GROUP BY statement.

SupportSQLiteQueryBuilder
having(having: String?)

Adds a HAVING statement.

SupportSQLiteQueryBuilder
limit(limit: String)

Adds a LIMIT statement.

SupportSQLiteQueryBuilder
orderBy(orderBy: String?)

Adds an ORDER BY statement.

SupportSQLiteQueryBuilder
selection(selection: String?, bindArgs: Array<Any?>?)

Sets the arguments for the WHERE clause.

Public companion functions

builder

Added in 2.3.0
fun builder(tableName: String): SupportSQLiteQueryBuilder

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.

Public functions

columns

Added in 2.0.0
fun columns(columns: Array<String>?): SupportSQLiteQueryBuilder

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

Parameters
columns: Array<String>?

The list of column names that should be returned.

create

Added in 2.0.0
fun create(): SupportSQLiteQuery

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

Returns
SupportSQLiteQuery

a new query

distinct

Added in 2.0.0
fun distinct(): SupportSQLiteQueryBuilder

Adds DISTINCT keyword to the query.

groupBy

Added in 2.0.0
fun groupBy(groupBy: String?): SupportSQLiteQueryBuilder

Adds a GROUP BY statement.

Parameters
groupBy: String?

The value of the GROUP BY statement.

having

Added in 2.0.0
fun having(having: String?): SupportSQLiteQueryBuilder

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

Parameters
having: String?

The having clause.

limit

Added in 2.0.0
fun limit(limit: String): SupportSQLiteQueryBuilder

Adds a LIMIT statement.

Parameters
limit: String

The limit value.

orderBy

Added in 2.0.0
fun orderBy(orderBy: String?): SupportSQLiteQueryBuilder

Adds an ORDER BY statement.

Parameters
orderBy: String?

The order clause.

selection

Added in 2.0.0
fun selection(selection: String?, bindArgs: Array<Any?>?): SupportSQLiteQueryBuilder

Sets the arguments for the WHERE clause.

Parameters
selection: String?

The list of selection columns

bindArgs: Array<Any?>?

The list of bind arguments to match against these columns