SupportSQLiteQueryBuilder

class SupportSQLiteQueryBuilder
kotlin.Any
   ↳ androidx.sqlite.db.SupportSQLiteQueryBuilder

A simple query builder to create SQL SELECT queries.

Summary

Public methods

static SupportSQLiteQueryBuilder!
builder(tableName: String!)

Creates a query for the given table name.

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(SupportSQLiteQuery).

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 methods

builder

static fun builder(tableName: String!): SupportSQLiteQueryBuilder!

Creates a query for the given table name.

Parameters
tableName String!: The table name(s) to query.
Return
SupportSQLiteQueryBuilder!: A builder to create a query.

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.
Return
SupportSQLiteQueryBuilder!: this

create

fun create(): SupportSQLiteQuery!

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

Return
SupportSQLiteQuery!: a new query

distinct

fun distinct(): SupportSQLiteQueryBuilder!

Adds DISTINCT keyword to the query.

Return
SupportSQLiteQueryBuilder!: this

groupBy

fun groupBy(groupBy: String!): SupportSQLiteQueryBuilder!

Adds a GROUP BY statement.

Parameters
groupBy String!: The value of the GROUP BY statement.
Return
SupportSQLiteQueryBuilder!: this

having

fun having(having: String!): SupportSQLiteQueryBuilder!

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

Parameters
having String!: The having clause.
Return
SupportSQLiteQueryBuilder!: this

limit

fun limit(limit: String!): SupportSQLiteQueryBuilder!

Adds a LIMIT statement.

Parameters
limit String!: The limit value.
Return
SupportSQLiteQueryBuilder!: this

orderBy

fun orderBy(orderBy: String!): SupportSQLiteQueryBuilder!

Adds an ORDER BY statement.

Parameters
orderBy String!: The order clause.
Return
SupportSQLiteQueryBuilder!: this

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 String!: The list of bind arguments to match against these columns
Return
SupportSQLiteQueryBuilder!: this