Move store storage behind an interface with a SQLite backend

Aperta
#52 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, sqlite
Ambito
backend, database

Direzione di ricerca

Start by locating Warehouse and the core module to understand how stores are currently loaded and saved; then inspect the existing test setup and SQLite JDBC dependency. The issue calls for a repository interface, SQLite and in-memory implementations, schema versioning, and a transaction log, but does not name specific files or tests. Done means the plugin uses SQLite for persistence, survives an unclean server shutdown, and tests use the in-memory implementation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem

Stores are saved to a single HOCON file by Warehouse. The whole file is rewritten on save, data can be lost if the server doesn't shut down cleanly, and there's nowhere to keep a transaction history.

Goal

Move storage behind an interface, with SQLite as the default backend for 1.0.

Scope

  • A repository interface (for example StoreRepository) in core, with one implementation per backend.
  • A SQLite implementation. Spigot and Paper already bundle the SQLite JDBC driver.
  • Keep store details (name, owner, location, flags) in memory, because the entrance check runs on every player move. Write item and balance changes as they happen, or shortly after in the background. Data must not depend on a clean shutdown.
  • A schema_version table from the start, so later schema changes can be applied automatically.
  • A transaction log table.
  • An in-memory implementation for tests. Making it selectable in the config is a stretch goal.

Out of scope

  • Importing existing 0.x data (separate issue).
  • MySQL or other remote databases.

Done when

  • The plugin runs entirely on SQLite, and stores survive a server crash (kill -9).
  • Tests use the in-memory implementation.
Lingua principale
Java
Stelle
1
Fork
0
Merge medio
2h 35m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di BrendonButler/Shops

Tutte le issue di BrendonButler/Shops

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.