Package com.enhancedechest.storage.sql
Class SqliteStorage
java.lang.Object
com.enhancedechest.storage.sql.AbstractSqlStorage
com.enhancedechest.storage.sql.SqliteStorage
- All Implemented Interfaces:
StorageBackend
-
Nested Class Summary
Nested classes/interfaces inherited from class com.enhancedechest.storage.sql.AbstractSqlStorage
AbstractSqlStorage.UpsertSyntaxNested classes/interfaces inherited from interface com.enhancedechest.storage.StorageBackend
StorageBackend.ChestKey, StorageBackend.ExpiredKey, StorageBackend.OwnerRows -
Field Summary
Fields inherited from class com.enhancedechest.storage.sql.AbstractSqlStorage
dataSource, tablePrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSnapshots the database withVACUUM INTO.booleanTrue if this backend can produce a file snapshot viaStorageBackend.backup(Path).Methods inherited from class com.enhancedechest.storage.sql.AbstractSqlStorage
close, countChests, findExpired, findUuidByName, flushDirty, importRows, init, loadAllPlayers, loadOwner
-
Constructor Details
-
SqliteStorage
-
-
Method Details
-
supportsBackup
public boolean supportsBackup()Description copied from interface:StorageBackendTrue if this backend can produce a file snapshot viaStorageBackend.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
Snapshots the database withVACUUM 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.
-