# SupportSQLiteQuery

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact android.arch.persistence:db:1.1.0-beta2  
Summary:[Methods](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#pubmethods)  

# SupportSQLiteQuery

| The`android.arch`Architecture Components packages are no longer maintained. They have been superseded by the corresponding[androidx.\*](https://developer.android.com/jetpack/androidx/migrate)packages. See[androidx.sqlite.db.SupportSQLiteQuery](https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteQuery)instead.

`
public


interface
SupportSQLiteQuery
`  
`


`

|------------------------------------------------|
| android.arch.persistence.db.SupportSQLiteQuery |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [SimpleSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery) |------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [SimpleSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery) | A basic implementation of[SupportSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery)which receives a query and its args and binds args based on the passed in Object type. | |

<br />

*** ** * ** ***

A query with typed bindings. It is better to use this API instead of[rawQuery(String, String[])](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`   | ` `[bindTo](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#bindTo(android.arch.persistence.db.SupportSQLiteProgram))`(`[SupportSQLiteProgram](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteProgram)` statement) ` Callback to bind the query parameters to the compiled statement. |
| ` abstract int`    | ` `[getArgCount](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#getArgCount())`() ` Returns the number of arguments in this query.                                                                                                                                                                                     |
| ` abstract String` | ` `[getSql](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#getSql())`() ` The SQL query.                                                                                                                                                                                                                               |

## Public methods

### bindTo

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void bindTo (SupportSQLiteProgram statement)
```

Callback to bind the query parameters to the compiled statement.

<br />

|                             Parameters                             ||
|-------------|-------------------------------------------------------|
| `statement` | `SupportSQLiteProgram`: The compiled statement <br /> |

### getArgCount

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

<br />

|                       Returns                       ||
|-------|----------------------------------------------|
| `int` | The number of arguments in the query. <br /> |

### getSql

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getSql ()
```

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

<br />

|                  Returns                  ||
|----------|---------------------------------|
| `String` | The SQL query to compile <br /> |

-

  ## Interfaces

  - [SupportSQLiteDatabase](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteDatabase)
  - [SupportSQLiteOpenHelper](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper)
  - [SupportSQLiteOpenHelper.Factory](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Factory)
  - [SupportSQLiteProgram](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteProgram)
  - [SupportSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery)
  - [SupportSQLiteStatement](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteStatement)
-

  ## Classes

  - [SimpleSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery)
  - [SupportSQLiteOpenHelper.Callback](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Callback)
  - [SupportSQLiteOpenHelper.Configuration](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Configuration)
  - [SupportSQLiteOpenHelper.Configuration.Builder](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Configuration.Builder)
  - [SupportSQLiteQueryBuilder](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQueryBuilder)