public final class SQLiteDatabaseConfiguration extends 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 |
---|---|
ArrayList<SQLiteCustomFunction> |
customFunctions
The custom functions to register.
|
boolean |
foreignKeyConstraintsEnabled
True if foreign key constraints are enabled.
|
String |
label
The label to use to describe the database when it appears in logs.
|
Locale |
locale
The database locale.
|
int |
maxSqlCacheSize
The maximum size of the prepared statement cache for each database connection.
|
static String |
MEMORY_DB_PATH
Special path used by in-memory databases.
|
int |
openFlags
The flags used to open the database.
|
String |
path
The database path.
|
Constructor and Description |
---|
SQLiteDatabaseConfiguration(SQLiteDatabaseConfiguration other)
Creates a database configuration as a copy of another configuration.
|
SQLiteDatabaseConfiguration(String path,
int openFlags)
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.
|
void |
updateParametersFrom(SQLiteDatabaseConfiguration other)
Updates the non-immutable parameters of this configuration object
from the other configuration object.
|
public static final String MEMORY_DB_PATH
public final String path
public final String label
public int openFlags
public int maxSqlCacheSize
public Locale locale
Locale.getDefault()
.public boolean foreignKeyConstraintsEnabled
public final ArrayList<SQLiteCustomFunction> customFunctions
public SQLiteDatabaseConfiguration(String path, int openFlags)
path
- The database path.openFlags
- Open flags for the database, such as SQLiteDatabase.OPEN_READWRITE
.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()