public final class SQLiteDatabaseConfiguration
extends java.lang.Object
The purpose of this object is to keep track of all of the little configuration settings that are applied to a database after it is opened so that they can be applied to all connections in the connection pool uniformly.
Each connection maintains its own copy of this object so it can keep track of which settings have already been applied.
| Modifier and Type | Field and Description |
|---|---|
boolean |
foreignKeyConstraintsEnabled
True if foreign key constraints are enabled.
|
java.lang.String |
label
The label to use to describe the database when it appears in logs.
|
java.util.Locale |
locale
The database locale.
|
int |
maxSqlCacheSize
The maximum size of the prepared statement cache for each database connection.
|
static java.lang.String |
MEMORY_DB_PATH
Special path used by in-memory databases.
|
int |
openFlags
The flags used to open the database.
|
java.lang.String |
path
The database path.
|
int |
walConnectionPoolSize
Maximum number of database connections opened and managed by framework layer
to handle queries on each database when using Write-Ahead Logging.
|
| Constructor and Description |
|---|
SQLiteDatabaseConfiguration(SQLiteDatabaseConfiguration other)
Creates a database configuration as a copy of another configuration.
|
SQLiteDatabaseConfiguration(java.lang.String path,
int openFlags,
int walConnectionPoolSize)
Creates a database configuration with the required parameters for opening a
database and default values for all other parameters.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isInMemoryDb()
Returns true if the database is in-memory.
|
boolean |
isOpenReadOnly()
Returns true of the database is open is in OPEN_READONLY mode.
|
void |
updateParametersFrom(SQLiteDatabaseConfiguration other)
Updates the non-immutable parameters of this configuration object
from the other configuration object.
|
public static final java.lang.String MEMORY_DB_PATH
public final java.lang.String path
public final java.lang.String label
public int openFlags
public int maxSqlCacheSize
public java.util.Locale locale
Locale.getDefault().public boolean foreignKeyConstraintsEnabled
public int walConnectionPoolSize
public SQLiteDatabaseConfiguration(java.lang.String path,
int openFlags,
int walConnectionPoolSize)
path - The database path.openFlags - Open flags for the database, such as SQLiteDatabase.OPEN_READWRITE.walConnectionPoolSize - public SQLiteDatabaseConfiguration(SQLiteDatabaseConfiguration other)
other - The other configuration.public void updateParametersFrom(SQLiteDatabaseConfiguration other)
other - The object from which to copy the parameters.public boolean isInMemoryDb()
public boolean isOpenReadOnly()