SimpleSQLiteQuery


public final class SimpleSQLiteQuery implements SupportSQLiteQuery


A basic implementation of SupportSQLiteQuery which receives a query and its args and binds args based on the passed in Object type.

Summary

Public constructors

Creates an SQL query without any bind arguments.

SimpleSQLiteQuery(@NonNull String query, Object[] bindArgs)

Creates an SQL query with the sql string and the bind arguments.

Public methods

static final void
bind(@NonNull SupportSQLiteProgram statement, Object[] bindArgs)

Binds the given arguments into the given sqlite statement.

void

Creates an SQL query without any bind arguments.

int

Is the number of arguments in this query.

@NonNull String

The SQL query.

Public constructors

SimpleSQLiteQuery

Added in 2.0.0
public SimpleSQLiteQuery(@NonNull String query)

Creates an SQL query without any bind arguments.

Parameters
@NonNull String query

The SQL query to execute. Cannot include bind parameters.

SimpleSQLiteQuery

Added in 2.0.0
public SimpleSQLiteQuery(@NonNull String query, Object[] bindArgs)

Creates an SQL query with the sql string and the bind arguments.

Parameters
@NonNull String query

The query string, can include bind arguments (.e.g ?).

Object[] bindArgs

The bind argument value that will replace the placeholders in the query.

Public methods

bind

Added in 2.3.0
public static final void bind(@NonNull SupportSQLiteProgram statement, Object[] bindArgs)

Binds the given arguments into the given sqlite statement.

Parameters
@NonNull SupportSQLiteProgram statement

The sqlite statement

Object[] bindArgs

The list of bind arguments

bindTo

Added in 2.5.0-alpha11
public void bindTo(@NonNull SupportSQLiteProgram statement)

Creates an SQL query without any bind arguments.

Parameters
@NonNull SupportSQLiteProgram statement

The SQL query to execute. Cannot include bind parameters.

getArgCount

Added in 2.5.0-alpha11
public int getArgCount()

Is 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.

getSql

Added in 2.5.0-alpha11
public @NonNull String getSql()

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