# SimpleSQLiteQuery

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

*** ** * ** ***


```
class SimpleSQLiteQuery : SupportSQLiteQuery
```

<br />

*** ** * ** ***

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

## Summary

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SimpleSQLiteQuery#bind(androidx.sqlite.db.SupportSQLiteProgram,kotlin.Array)(statement: https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteProgram, bindArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>?)` Binds the given arguments into the given sqlite statement. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SimpleSQLiteQuery#SimpleSQLiteQuery(kotlin.String)(query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Creates an SQL query without any bind arguments. |
| `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SimpleSQLiteQuery#SimpleSQLiteQuery(kotlin.String,kotlin.Array)(query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, bindArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>?)` Creates an SQL query with the sql string and the bind arguments. |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SimpleSQLiteQuery#bindTo(androidx.sqlite.db.SupportSQLiteProgram)(statement: https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteProgram)` Creates an SQL query without any bind arguments. |

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SimpleSQLiteQuery#argCount()` Is the number of arguments in this query. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SimpleSQLiteQuery#sql()` The SQL query. |

## Public companion functions

### bind

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

```
fun bind(statement: SupportSQLiteProgram, bindArgs: Array<Any?>?): Unit
```

Binds the given arguments into the given sqlite statement.

| Parameters |
|---|---|
| `statement: https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteProgram` | The sqlite statement |
| `bindArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>?` | The list of bind arguments |

## Public constructors

### SimpleSQLiteQuery

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

```
SimpleSQLiteQuery(query: String)
```

Creates an SQL query without any bind arguments.

| Parameters |
|---|---|
| `query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The SQL query to execute. Cannot include bind parameters. |

### SimpleSQLiteQuery

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

```
SimpleSQLiteQuery(query: String, bindArgs: Array<Any?>?)
```

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

| Parameters |
|---|---|
| `query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The query string, can include bind arguments (.e.g ?). |
| `bindArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>?` | The bind argument value that will replace the placeholders in the query. |

## Public functions

### bindTo

```
open fun bindTo(statement: SupportSQLiteProgram): Unit
```

Creates an SQL query without any bind arguments.

| Parameters |
|---|---|
| `statement: https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteProgram` | The SQL query to execute. Cannot include bind parameters. |

## Public properties

### argCount

```
open val argCount: Int
```

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.

### sql

```
open val sql: String
```

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