# RoomDatabase.JournalMode

Artifact: [androidx.room3:room3-runtime](https://developer.android.com/jetpack/androidx/releases/room3) [View Source](https://cs.android.com/search?q=file:androidx/room3/RoomDatabase.+class:androidx.room3.RoomDatabase.JournalMode) Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  enum RoomDatabase.JournalMode : Enum<RoomDatabase.JournalMode>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[RoomDatabase.JournalMode](https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode)\> ||
|   | ↳ | [androidx.room3.RoomDatabase.JournalMode](https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode) |

*** ** * ** ***

Journal modes for SQLite database.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.Builder` | #setJournalMode |

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#AUTOMATIC` | Let Room choose the journal mode. |
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#TRUNCATE` | Truncate journal mode. |
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#WRITE_AHEAD_LOGGING` | Write-Ahead Logging mode. |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | android |
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode>` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode>` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode>` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode>` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode>` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode>` | `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | Cmn |

## Enum Values

### AUTOMATIC

```
val RoomDatabase.JournalMode.AUTOMATIC: RoomDatabase.JournalMode
```

Let Room choose the journal mode. This is the default value when no explicit value is specified.

The actual value will be `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#TRUNCATE` when the device runs API Level lower than 16 or it is a low-RAM device. Otherwise, `https://developer.android.com/reference/kotlin/androidx/room3/RoomDatabase.JournalMode#WRITE_AHEAD_LOGGING` will be used.

### TRUNCATE

```
val RoomDatabase.JournalMode.TRUNCATE: RoomDatabase.JournalMode
```

Truncate journal mode.

### WRITE_AHEAD_LOGGING

```
val RoomDatabase.JournalMode.WRITE_AHEAD_LOGGING: RoomDatabase.JournalMode
```

Write-Ahead Logging mode.

## Public functions

### valueOf

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

```
fun valueOf(value: String): RoomDatabase.JournalMode
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### valueOf

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
fun valueOf(value: String): RoomDatabase.JournalMode
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### valueOf

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
fun valueOf(value: String): RoomDatabase.JournalMode
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

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

```
fun values(): Array<RoomDatabase.JournalMode>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

### values

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
fun values(): Array<RoomDatabase.JournalMode>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

### values

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
fun values(): Array<RoomDatabase.JournalMode>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

android

```
val entries: EnumEntries<RoomDatabase.JournalMode>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.

### entries

Cmn

```
val entries: EnumEntries<RoomDatabase.JournalMode>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.

### entries

Cmn

```
val entries: EnumEntries<RoomDatabase.JournalMode>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.