Enum Class SynchronousMode
- All Implemented Interfaces:
Serializable, Comparable<SynchronousMode>, Constable
SQLite synchronous modes.
Controls how aggressively SQLite writes data to disk. Higher durability comes at the cost of performance.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExtra synchronous mode similar toFULLbut with additional directory sync operations for maximum durability.SQLite syncs the database file after every write transaction.SQLite syncs at the most critical moments, but less often than inFULLmode.SQLite continues without syncing as soon as it has handed data off to the operating system. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the integer value used inPRAGMA synchronousstatements.toSql()Returns the SQL string for this synchronous mode.static SynchronousModeReturns the enum constant of this class with the specified name.static SynchronousMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OFF
SQLite continues without syncing as soon as it has handed data off to the operating system. Fastest but least safe. Data may be lost in a power loss or operating system crash. -
NORMAL
SQLite syncs at the most critical moments, but less often than inFULLmode. A good compromise between safety and speed. -
FULL
SQLite syncs the database file after every write transaction. Safest but slowest. Guarantees that data is written to disk. -
EXTRA
Extra synchronous mode similar toFULLbut with additional directory sync operations for maximum durability.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
pragmaValue
public int pragmaValue()Returns the integer value used inPRAGMA synchronousstatements.- Returns:
- PRAGMA value
-
toSql
Returns the SQL string for this synchronous mode.- Returns:
- SQL string (e.g., "OFF", "NORMAL", "FULL", "EXTRA")
-