Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# OpenParams

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.OpenParams "View this page in Java")

```
class OpenParams
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.database.sqlite.SQLiteDatabase.OpenParams](https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#) |

Wrapper for configuration parameters that are used for opening `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase`

## Summary

| Nested classes ||
|---|---|
|   | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder` Builder for `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#`. |

| Public methods ||
|---|---|
| [SQLiteDatabase.CursorFactory](https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.CursorFactory)? | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getCursorFactory()()` Returns an optional factory class that is called to instantiate a cursor when query is called |
| [DatabaseErrorHandler](https://developer.android.com/reference/kotlin/android/database/DatabaseErrorHandler.html#)? | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getErrorHandler()()` Returns handler for database corruption errors |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getIdleConnectionTimeout()()` Returns maximum number of milliseconds that SQLite connection is allowed to be idle before it is closed and removed from the pool. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getJournalMode()()` Returns [journal mode](https://sqlite.org/pragma.html#pragma_journal_mode). |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getLookasideSlotCount()()` Returns total number of lookaside memory slots per database connection or -1 if not set. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getLookasideSlotSize()()` Returns size in bytes of each lookaside slot or -1 if not set. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getOpenFlags()()` Returns flags to control database access mode. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams#getSynchronousMode()()` Returns [synchronous mode](https://sqlite.org/pragma.html#pragma_synchronous). |

## Public methods

### getCursorFactory

Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getCursorFactory(): SQLiteDatabase.CursorFactory?
```

Returns an optional factory class that is called to instantiate a cursor when query is called

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.CursorFactory?` | This value may be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setCursorFactory(android.database.sqlite.SQLiteDatabase.CursorFactory)`

### getErrorHandler

Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getErrorHandler(): DatabaseErrorHandler?
```

Returns handler for database corruption errors

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/database/DatabaseErrorHandler.html#?` | This value may be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setErrorHandler(android.database.DatabaseErrorHandler)`

### getIdleConnectionTimeout

Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getIdleConnectionTimeout(): Long
```

Returns maximum number of milliseconds that SQLite connection is allowed to be idle before it is closed and removed from the pool.

If the value isn't set, the timeout defaults to the system wide timeout

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | timeout in milliseconds or -1 if the value wasn't set. |

### getJournalMode

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getJournalMode(): String?
```

Returns [journal mode](https://sqlite.org/pragma.html#pragma_journal_mode). set via `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setJournalMode(kotlin.String)`.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | This value may be `null`. |

### getLookasideSlotCount

Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getLookasideSlotCount(): Int
```

Returns total number of lookaside memory slots per database connection or -1 if not set.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is -1 or greater |

**See Also**

- `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setLookasideConfig(kotlin.Int,%20kotlin.Int)`

### getLookasideSlotSize

Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getLookasideSlotSize(): Int
```

Returns size in bytes of each lookaside slot or -1 if not set.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is -1 or greater |

**See Also**

- `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setLookasideConfig(kotlin.Int,%20kotlin.Int)`

### getOpenFlags

Added in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getOpenFlags(): Int
```

Returns flags to control database access mode. Default value is 0.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase#OPEN_READWRITE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase#OPEN_READONLY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase#CREATE_IF_NECESSARY:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase#NO_LOCALIZED_COLLATORS:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase#ENABLE_WRITE_AHEAD_LOGGING:kotlin.Int` |

**See Also**

- `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setOpenFlags(kotlin.Int)`

### getSynchronousMode

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getSynchronousMode(): String?
```

Returns [synchronous mode](https://sqlite.org/pragma.html#pragma_synchronous). If not set, a system wide default will be used.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | This value may be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/database/sqlite/SQLiteDatabase.OpenParams.Builder#setSynchronousMode(kotlin.String)`