uxmlib-storage
Pooled JDBC with a query builder, versioned migrations, schema tools, caching layers and cross-server row sync.
Plain JDBC, pooled by HikariCP, with the pieces around it that a plugin otherwise writes badly: parameterised queries that cannot be concatenated wrong, migrations that run once, a cache that matches the shape of player data, and a way to keep several servers in step.
There is no ORM here and no entity manager. A Repository is a base class you extend with a row
mapper and a bind, not a framework.
| Page | Covers |
|---|---|
| Database | Pooling, SQLite and network backends, transactions, dialects |
| Queries | Sql, the query builders, resilient loads, keyset paging, typed columns |
| Migrations | Versioned migrations, schema introspection, column operations |
| Caching | Write-through, write-behind, the player profile cache, repositories |
| Cross-server sync | Row sync, synchronizers, message encoding |
The short version
Database db = Database.builder().sqlite(dataFolder.resolve("data.db")).build();
new MigrationRunner(db).apply(List.of(
new Migration(1, "init", "CREATE TABLE players (uuid TEXT PRIMARY KEY, coins INTEGER)")));
Sql sql = new Sql(db);
Query top = SelectBuilder.from("players")
.where("coins", ">=", 100)
.orderByDescending("coins")
.limit(10)
.build();
List<String> leaders = sql.query(top, row -> row.getString("uuid"));
SQLite is the default and needs no configuration. Switching to MySQL, MariaDB, PostgreSQL or H2 is a JDBC URL, credentials and the matching driver on the classpath.
Was this page helpful?