Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 2.0.0
belongs to Maven artifact androidx.sqlite:sqlite:2.0.0-rc01

SupportSQLiteQuery

public interface SupportSQLiteQuery

androidx.sqlite.db.SupportSQLiteQuery


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

Summary

Public methods

abstract void bindTo(SupportSQLiteProgram statement)

Callback to bind the query parameters to the compiled statement.

abstract int getArgCount()

Returns the number of arguments in this query.

abstract String getSql()

The SQL query.

Public methods

bindTo

added in version 2.0.0
public abstract void bindTo (SupportSQLiteProgram statement)

Callback to bind the query parameters to the compiled statement.

Parameters
statement SupportSQLiteProgram: The compiled statement

getArgCount

added in version 2.0.0
public abstract int getArgCount ()

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.

Returns
int The number of arguments in the query.

getSql

added in version 2.0.0
public abstract String getSql ()

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

Returns
String The SQL query to compile