using Robust.Shared.Configuration; namespace Content.Shared.CCVar; public sealed partial class CCVars { #if DEBUG private const int DefaultSqliteDelay = 1; #else private const int DefaultSqliteDelay = 0; #endif public static readonly CVarDef DatabaseEngine = CVarDef.Create("database.engine", "sqlite", CVar.SERVERONLY); public static readonly CVarDef DatabaseSqliteDbPath = CVarDef.Create("database.sqlite_dbpath", "preferences.db", CVar.SERVERONLY); /// /// Milliseconds to asynchronously delay all SQLite database acquisitions with. /// /// /// Defaults to 1 on DEBUG, 0 on RELEASE. /// This is intended to help catch .Result deadlock bugs that only happen on postgres /// (because SQLite is not actually asynchronous normally) /// public static readonly CVarDef DatabaseSqliteDelay = CVarDef.Create("database.sqlite_delay", DefaultSqliteDelay, CVar.SERVERONLY); /// /// Amount of concurrent SQLite database operations. /// /// /// Note that SQLite is not a properly asynchronous database and also has limited read/write concurrency. /// Increasing this number may allow more concurrent reads, but it probably won't matter much. /// SQLite operations are normally ran on the thread pool, which may cause thread pool starvation if the concurrency is too high. /// public static readonly CVarDef DatabaseSqliteConcurrency = CVarDef.Create("database.sqlite_concurrency", 3, CVar.SERVERONLY); public static readonly CVarDef DatabasePgHost = CVarDef.Create("database.pg_host", "localhost", CVar.SERVERONLY); public static readonly CVarDef DatabasePgPort = CVarDef.Create("database.pg_port", 5432, CVar.SERVERONLY); public static readonly CVarDef DatabasePgDatabase = CVarDef.Create("database.pg_database", "ss14", CVar.SERVERONLY); public static readonly CVarDef DatabasePgUsername = CVarDef.Create("database.pg_username", "postgres", CVar.SERVERONLY); public static readonly CVarDef DatabasePgPassword = CVarDef.Create("database.pg_password", "", CVar.SERVERONLY | CVar.CONFIDENTIAL); /// /// Max amount of concurrent Postgres database operations. /// public static readonly CVarDef DatabasePgConcurrency = CVarDef.Create("database.pg_concurrency", 8, CVar.SERVERONLY); /// /// Milliseconds to asynchronously delay all PostgreSQL database operations with. /// /// /// This is intended for performance testing. It works different from , /// as the lag is applied after acquiring the database lock. /// public static readonly CVarDef DatabasePgFakeLag = CVarDef.Create("database.pg_fake_lag", 0, CVar.SERVERONLY); /// /// Basically only exists for integration tests to avoid race conditions. /// public static readonly CVarDef DatabaseSynchronous = CVarDef.Create("database.sync", false, CVar.SERVERONLY); }