Move store storage behind an interface with a SQLite backend

Abierto
#52 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, sqlite
Área
backend, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Java
Estrellas
1
Forks
0
Merge medio
2 h 35 min
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BrendonButler/Shops

Todos los issues de BrendonButler/Shops

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.