ProVouchers

Storage and Database

Configure SQLite, MySQL, MariaDB, or PostgreSQL, and understand what is stored.

ProVouchers persists anti-dupe stamps and code-use counters in a database through Strata's pooled storage. The backend is chosen in config.yml. The default needs no setup.

Choosing a backend

config.yml
storage:
  # backend: sqlite | mysql | mariadb | postgres
  backend: sqlite
  # The settings below are used only by the networked backends.
  host: localhost
  port: 5432
  database: provouchers
  username: provouchers
  password: ""
  pool-size: 10
BackendWhen to useSetup
sqliteSingle server, zero setup (default)None. Creates plugins/ProVouchers/data.db.
mysqlA network sharing one databaseA MySQL server and database
mariadbSame as MySQL, MariaDB driverA MariaDB server and database
postgresSame, PostgreSQLA PostgreSQL server and database

The JDBC driver and connection pool are provided by Strata; you do not install or shade anything yourself.

SQLite (default)

Nothing to configure. A data.db file is created in the plugin folder on first start. Best for a single server.

MySQL / MariaDB / PostgreSQL

Create a database and a user, then point config.yml at it:

config.yml (PostgreSQL example)
storage:
  backend: postgres
  host: 10.0.0.5
  port: 5432
  database: provouchers
  username: provouchers
  password: "a-strong-password"
  pool-size: 10

pool-size is the maximum number of pooled connections. The default of 10 is fine for most servers; raise it only if you run a large network with heavy redemption traffic. The default ports are 3306 for MySQL/MariaDB and 5432 for PostgreSQL.

Use a networked backend (MySQL, MariaDB, or PostgreSQL) when several servers should share anti-dupe and code-use data, so a voucher item or a one-time code cannot be redeemed again on a different server in the network.

What is stored

ProVouchers keeps a small, indexed schema (tables are prefixed provouchers_):

TableHolds
provouchers_redeemed_stampsOne row per redeemed voucher item, keyed by its batch and nonce. Powers anti-dupe.
provouchers_code_usesPer-player redemption counts for codes. Powers uses-per-player and max-uses.
provouchers_cooldownsPer-player, per-voucher cooldown expiry. Survives restarts; loaded on join.
provouchers_offline_givesReserved for the planned offline-give queue.

Lookups are by primary key and writes happen off the main thread, so storage never blocks gameplay. The schema is created and migrated automatically on first start.

On this page