3.1 KiB
Infrastructure
MySQL Container
The MySQL 8.4 OLTP database runs in Docker (or Podman) for easy setup and teardown without requiring a local MySQL installation.
Starting and stopping
Linux (Docker):
./docker/start.sh # start
./docker/stop.sh # stop (data is preserved)
Linux (Podman):
./docker/start.sh --podman
./docker/stop.sh --podman
Windows (PowerShell):
./docker/start.ps1
./docker/stop.ps1
Connection details
| Property | Value |
|---|---|
| Host | 127.0.0.1 |
| Port | 13306 (non-standard to avoid conflicts with any local MySQL) |
| Database | ewc2025 |
| User | root |
| Password | ewc2025root |
What happens on first start
When the container is created for the first time, MySQL automatically executes any .sql files found in /docker-entrypoint-initdb.d/. The start script mounts sql/schema.sql there, so the database schema is created automatically — you do not need to run the DDL manually.
Data persistence
Container data is stored in a named Docker/Podman volume (ewc2025-mysql-data). Stopping and restarting the container does not lose any data.
To fully reset the database (drop all data and re-create from scratch):
docker rm ewc2025-mysql
docker volume rm ewc2025-mysql-data
./docker/start.sh # fresh container, empty schema
dotnet run ./scripts/seed.cs
Seed Script
The seed script (scripts/seed.cs) is a single-file .NET 10 C# script — no project file or solution needed.
Requirements
- .NET 10 SDK installed
- MySQL container running
Running it
dotnet run ./scripts/seed.cs
The script can be run from any directory — it walks up the directory tree to find the data/ folder automatically.
What it does
Reads all 10 CSV files and inserts data into MySQL in this order:
game— deduplicates game names from file 01country— from file 08; additional countries auto-inserted as encounteredpoint_system— from file 09prize_pool_category— from file 06organization— collects all org names across files 02–05, 10; enriches with file 04 detailstournament— from file 01schedule— from file 07; matched to tournaments by game name + start dateplayer— from file 05medalist— from file 02match_result— from file 10club_championship_standing— from file 03organization_game_competing— from file 04 (multi-value column split)organization_game_won— from file 03 (multi-value column split)
Expected output on a clean database:
Connected to MySQL.
[1/13] game
[2/13] country
...
[13/13] organization_game_won
Done. Database seeded.
A WARN: line is printed for Battlegrounds Mobile India (not an EWC 2025 tournament — expected and harmless).
NuGet packages used
| Package | Purpose |
|---|---|
MySqlConnector 2.3.7 |
MySQL database driver |
CsvHelper 33.0.1 |
CSV parsing (handles quoted fields with commas) |
These are declared at the top of the script with #:package directives and restored automatically by dotnet run.