/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.database.sqlite; import java.util.ArrayList; import java.util.Locale; import java.util.regex.Pattern; /** * Describes how to configure a database. *
* 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. *
* * @hide */ public final class SQLiteDatabaseConfiguration { // The pattern we use to strip email addresses from database paths // when constructing a label to use in log messages. private static final Pattern EMAIL_IN_DB_PATTERN = Pattern.compile("[\\w\\.\\-]+@[\\w\\.\\-]+"); /** * Special path used by in-memory databases. */ public static final String MEMORY_DB_PATH = ":memory:"; /** * The database path. */ public final String path; /** * The label to use to describe the database when it appears in logs. * This is derived from the path but is stripped to remove PII. */ public final String label; /** * The flags used to open the database. */ public int openFlags; /** * The maximum size of the prepared statement cache for each database connection. * Must be non-negative. * * Default is 25. */ public int maxSqlCacheSize; /** * The database locale. * * Default is the value returned by {@link Locale#getDefault()}. */ public Locale locale; /** * True if foreign key constraints are enabled. * * Default is false. */ public boolean foreignKeyConstraintsEnabled; /** * The custom functions to register. */ public final ArrayList