belongs to Maven artifact androidx.room:room-runtime:2.0.0-alpha1

DatabaseConfiguration

public class DatabaseConfiguration
extends Object

java.lang.Object
   ↳ androidx.room.DatabaseConfiguration


Configuration class for a RoomDatabase.

Summary

Fields

public final boolean allowMainThreadQueries

Whether Room should throw an exception for queries run on the main thread.

public final List<RoomDatabase.Callback> callbacks

public final Context context

The context to use while connecting to the database.

public final RoomDatabase.JournalMode journalMode

The journal mode for this database.

public final RoomDatabase.MigrationContainer migrationContainer

Collection of available migrations.

public final String name

The name of the database file or null if it is an in-memory database.

public final boolean requireMigration

If true, Room should crash if a migration is missing.

public final SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory

The factory to use to access the database.

Public methods

boolean isMigrationRequiredFrom(int version)

Returns whether a migration is required from the specified version.

Inherited methods

Fields

allowMainThreadQueries

boolean allowMainThreadQueries

Whether Room should throw an exception for queries run on the main thread.

callbacks

List<RoomDatabase.Callback> callbacks

context

Context context

The context to use while connecting to the database.

journalMode

RoomDatabase.JournalMode journalMode

The journal mode for this database.

migrationContainer

RoomDatabase.MigrationContainer migrationContainer

Collection of available migrations.

name

String name

The name of the database file or null if it is an in-memory database.

requireMigration

boolean requireMigration

If true, Room should crash if a migration is missing.

sqliteOpenHelperFactory

SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory

The factory to use to access the database.

Public methods

isMigrationRequiredFrom

boolean isMigrationRequiredFrom (int version)

Returns whether a migration is required from the specified version.

Parameters
version int: The schema version.

Returns
boolean True if a valid migration is required, false otherwise.