Class SqliteStorage

java.lang.Object
com.enhancedechest.storage.sql.AbstractSqlStorage
com.enhancedechest.storage.sql.SqliteStorage
All Implemented Interfaces:
StorageBackend

public final class SqliteStorage extends AbstractSqlStorage
  • Constructor Details

    • SqliteStorage

      public SqliteStorage(Path dataFolder, String fileName, String tablePrefix)
  • Method Details

    • supportsBackup

      public boolean supportsBackup()
      Description copied from interface: StorageBackend
      True if this backend can produce a file snapshot via StorageBackend.backup(Path). Only the file-based SQLite backend supports it; remote backends (MySQL/MariaDB/Postgres) return false and must be backed up with the database server's own tooling.
    • backup

      public void backup(Path target) throws Exception
      Snapshots the database with VACUUM INTO. Unlike copying the .db file, this produces a defragmented, transactionally-consistent copy even while saves are happening, so there is no need to pause the plugin or risk a torn read. The target must not already exist (the caller supplies a unique timestamped name).
      Throws:
      Exception - if the snapshot fails; the caller logs it and leaves the live DB untouched.