# SupportSQLiteQuery

Artifact: [androidx.sqlite:sqlite](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/db/SupportSQLiteQuery.android.kt+class:androidx.sqlite.db.SupportSQLiteQuery) Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.0.0)

*** ** * ** ***

<br />

```
public interface SupportSQLiteQuery
```

<br />

Known direct subclasses [SimpleSQLiteQuery](https://developer.android.com/reference/androidx/sqlite/db/SimpleSQLiteQuery)

|---|---|
| `https://developer.android.com/reference/androidx/sqlite/db/SimpleSQLiteQuery` | A basic implementation of `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteQuery` which receives a query and its args and binds args based on the passed in Object type. |

*** ** * ** ***

A query with typed bindings. It is better to use this API instead of `https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#rawQuery(java.lang.String, java.lang.String[])` because it allows binding type safe parameters.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteQuery#bindTo(androidx.sqlite.db.SupportSQLiteProgram)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteProgram statement)` Callback to bind the query parameters to the compiled statement. |
| `abstract int` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteQuery#getArgCount()()` Is the number of arguments in this query. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteQuery#getSql()()` The SQL query. |

## Public methods

### bindTo

Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.0.0)

```
abstract void bindTo(@NonNull SupportSQLiteProgram statement)
```

Callback to bind the query parameters to the compiled statement.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteProgram statement` | The compiled statement |

### getArgCount

Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.0.0)

```
abstract 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.0.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.0.0)

```
abstract @NonNull String getSql()
```

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