Register now for Android Dev Summit 2019!

SupportSQLiteQuery

interface SupportSQLiteQuery
androidx.sqlite.db.SupportSQLiteQuery

A query with typed bindings. It is better to use this API instead of android.database.sqlite.SQLiteDatabase#rawQuery(String, String[]) because it allows binding type safe parameters.

Summary

Public methods

abstract Unit

Callback to bind the query parameters to the compiled statement.

abstract Int

Returns the number of arguments in this query.

abstract String!

The SQL query.

Public methods

bindTo

abstract fun bindTo(statement: SupportSQLiteProgram!): Unit

Callback to bind the query parameters to the compiled statement.

Parameters
statement SupportSQLiteProgram!: The compiled statement

getArgCount

abstract fun getArgCount(): Int

Returns the number of arguments in this query. This is equal to the number of placeholders in the query string. See: https://www.sqlite.org/c3ref/bind_blob.html for details.

Return
Int: The number of arguments in the query.

getSql

abstract fun getSql(): String!

The SQL query. This query can have placeholders(?) for bind arguments.

Return
String!: The SQL query to compile