# SupportSQLiteOpenHelper.Configuration

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

*** ** * ** ***


```
class SupportSQLiteOpenHelper.Configuration
```

<br />

*** ** * ** ***

The configuration to create an SQLite open helper object using `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Factory`.

## Summary

| ### Nested types |
|---|
| `open class https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration.Builder` Builder class for `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration`. |

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration.Builder` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#builder(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Creates a new Configuration.Builder to create an instance of Configuration. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#Configuration(android.content.Context,kotlin.String,androidx.sqlite.db.SupportSQLiteOpenHelper.Callback,kotlin.Boolean,kotlin.Boolean)( context: https://developer.android.com/reference/android/content/Context.html, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, callback: https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Callback, useNoBackupDirectory: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, allowDataLossOnRecovery: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#allowDataLossOnRecovery()` If `true` the database will be delete and its data loss in the case that it cannot be opened. |
| `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Callback` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#callback()` The callback class to handle creation, upgrade and downgrade. |
| `https://developer.android.com/reference/android/content/Context.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#context()` Context to use to open or create the database. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#name()` Name of the database file, or null for an in-memory database. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#useNoBackupDirectory()` If `true` the database will be stored in the no-backup directory. |

## Public companion functions

### builder

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

```
fun builder(context: Context): SupportSQLiteOpenHelper.Configuration.Builder
```

Creates a new Configuration.Builder to create an instance of Configuration.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | to use to open or create the database. |

## Public constructors

### Configuration

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

```
Configuration(
    context: Context,
    name: String?,
    callback: SupportSQLiteOpenHelper.Callback,
    useNoBackupDirectory: Boolean = false,
    allowDataLossOnRecovery: Boolean = false
)
```

## Public properties

### allowDataLossOnRecovery

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

```
val allowDataLossOnRecovery: Boolean
```

If `true` the database will be delete and its data loss in the case that it cannot be opened.

### callback

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

```
val callback: SupportSQLiteOpenHelper.Callback
```

The callback class to handle creation, upgrade and downgrade.

### context

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

```
val context: Context
```

Context to use to open or create the database.

### name

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

```
val name: String?
```

Name of the database file, or null for an in-memory database.

### useNoBackupDirectory

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

```
val useNoBackupDirectory: Boolean
```

If `true` the database will be stored in the no-backup directory.