# 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)

*** ** * ** ***


```
public final class SupportSQLiteOpenHelper.Configuration
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public fields |
|---|---|
| `final boolean` | `https://developer.android.com/reference/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. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Callback` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#callback()` The callback class to handle creation, upgrade and downgrade. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#context()` Context to use to open or create the database. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#name()` Name of the database file, or null for an in-memory database. |
| `final boolean` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#useNoBackupDirectory()` If `true` the database will be stored in the no-backup directory. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#Configuration(android.content.Context,kotlin.String,androidx.sqlite.db.SupportSQLiteOpenHelper.Callback,kotlin.Boolean,kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Callback callback, boolean useNoBackupDirectory, boolean allowDataLossOnRecovery )` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration.Builder` | `https://developer.android.com/reference/androidx/sqlite/db/SupportSQLiteOpenHelper.Configuration#builder(android.content.Context)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context)` Creates a new Configuration.Builder to create an instance of Configuration. |

## Public fields

### allowDataLossOnRecovery

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

```
public final boolean allowDataLossOnRecovery
```

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)

```
public final @NonNull SupportSQLiteOpenHelper.Callback 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)

```
public final @NonNull 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)

```
public final String name
```

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)

```
public final boolean useNoBackupDirectory
```

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

## Public constructors

### Configuration

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

```
public Configuration(
    @NonNull Context context,
    String name,
    @NonNull SupportSQLiteOpenHelper.Callback callback,
    boolean useNoBackupDirectory,
    boolean allowDataLossOnRecovery
)
```

## Public methods

### builder

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

```
public static final @NonNull SupportSQLiteOpenHelper.Configuration.Builder builder(@NonNull Context context)
```

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

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