Enum Class SynchronousMode

java.lang.Object
java.lang.Enum<SynchronousMode>
dev.rafex.ether.database.sqlite.config.SynchronousMode
All Implemented Interfaces:
Serializable, Comparable<SynchronousMode>, Constable

public enum SynchronousMode extends Enum<SynchronousMode>
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 Constants
    Enum Constant
    Description
    Extra synchronous mode similar to FULL but 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 in FULL mode.
    SQLite continues without syncing as soon as it has handed data off to the operating system.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the integer value used in PRAGMA synchronous statements.
    Returns the SQL string for this synchronous mode.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • OFF

      public static final SynchronousMode 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

      public static final SynchronousMode NORMAL
      SQLite syncs at the most critical moments, but less often than in FULL mode. A good compromise between safety and speed.
    • FULL

      public static final SynchronousMode FULL
      SQLite syncs the database file after every write transaction. Safest but slowest. Guarantees that data is written to disk.
    • EXTRA

      public static final SynchronousMode EXTRA
      Extra synchronous mode similar to FULL but with additional directory sync operations for maximum durability.
  • Method Details

    • values

      public static SynchronousMode[] 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

      public static SynchronousMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • pragmaValue

      public int pragmaValue()
      Returns the integer value used in PRAGMA synchronous statements.
      Returns:
      PRAGMA value
    • toSql

      public String toSql()
      Returns the SQL string for this synchronous mode.
      Returns:
      SQL string (e.g., "OFF", "NORMAL", "FULL", "EXTRA")