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.

android

Public functions

SupportSQLiteQueryBuilder
columns(columns: Array<String>?)

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

android
SupportSQLiteQuery

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

android
SupportSQLiteQueryBuilder

Adds DISTINCT keyword to the query.

android
SupportSQLiteQueryBuilder
groupBy(groupBy: String?)

Adds a GROUP BY statement.

android
SupportSQLiteQueryBuilder
having(having: String?)

Adds a HAVING statement.

android
SupportSQLiteQueryBuilder
limit(limit: String)

Adds a LIMIT statement.

android
SupportSQLiteQueryBuilder
orderBy(orderBy: String?)

Adds an ORDER BY statement.

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

Sets the arguments for the WHERE clause.

android

Public companion functions

builder

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

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

fun create(): SupportSQLiteQuery

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

Returns
SupportSQLiteQuery

a new query

distinct

fun distinct(): SupportSQLiteQueryBuilder

Adds DISTINCT keyword to the query.

groupBy

fun groupBy(groupBy: String?): SupportSQLiteQueryBuilder

Adds a GROUP BY statement.

Parameters
groupBy: String?

The value of the GROUP BY statement.

having

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

fun limit(limit: String): SupportSQLiteQueryBuilder

Adds a LIMIT statement.

Parameters
limit: String

The limit value.

orderBy

fun orderBy(orderBy: String?): SupportSQLiteQueryBuilder

Adds an ORDER BY statement.

Parameters
orderBy: String?

The order clause.

selection

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