Libraries
The CodeLogic Libraries suite is twelve independent NuGet packages. Each is a CodeLogic
ILibrary — load the ones you need, configure them through their JSON files, and use them from
your application or from other libraries after StartAsync().
MySQL / MariaDB / Percona — typed LINQ → SQL, result cache, schema-sync modes, migrations.
PostgreSQL — multi-database, repository + query builder, table sync, backups.
SQLite — custom pool, WAL, repository + query builder, migration runner.
SMTP send, IMAP read + IDLE, and a template engine.
Discord webhooks and Steam Web API.
DNSBL checks and GeoIP2 lookups.
Valve A2S/RCON and Minecraft queries.
CPU, memory, process, and uptime stats (cross-platform).
Git repository automation via LibGit2Sharp.
Shared conventions
The libraries follow a handful of consistent patterns, so once you've used one the rest feel familiar.
Loading & access
await Libraries.LoadAsync<CL.MySQL2.MySQL2Library>(); // register before ConfigureAsync()
await CodeLogic.ConfigureAsync();
await CodeLogic.StartAsync();
var mysql = Libraries.Get<CL.MySQL2.MySQL2Library>(); // resolve after StartAsync()
Result-based APIs
Most operations return Result / Result<T> rather than throwing for expected failures:
var result = await repo.GetByIdAsync(42);
if (result.IsSuccess)
Use(result.Value);
else
log.Warn(result.Error?.Message);
Configuration files
Each library auto-generates its JSON config on first run under its own config directory
(e.g. …/Libraries/CL.MySQL2/config.mysql.json). Defaults are written if the file is missing,
so first boot always succeeds and you tune from there.
Health checks
Every library implements HealthCheckAsync():
var status = await mysql.HealthCheckAsync();
// status.Status : Healthy | Degraded | Unhealthy
// status.Message, status.Data (structured metrics)
The database trio
CL.MySQL2, CL.PostgreSQL, and CL.SQLite share the same shape — GetRepository<T>() for CRUD
and a fluent query builder (Query<T>() on MySQL2/PostgreSQL, GetQueryBuilder<T>() on SQLite)
that translates LINQ-style expressions to SQL, plus attribute-driven table sync.
See the API Reference for the full generated type and member listing.