Skip to content

Configuration Class ​

Definition ​

Configuration for Database operations. Overrides any conflicting property names from JASE Core Config

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Properties ​

NameDescription
ApplicationNameApplication Name used in connection strings for supported providers
CacheModeSpecifies the Cache Mode for caching of database operational data (Default: Isolated)
CommandHistoryMaxSizeMaximum number of commands tracked in a Connection's CommandHistory property (Default: 500)
DefaultCharacterMaxLengthDefault length of character fields if not expressly set (Default: 255)
DefaultCommandHistoryTrackingThe default value for tracking command history on a Connection instance (Default: false)
DefaultCommandTimeoutThe default timeout in seconds when executing a database command (Default: 60 seconds)
DefaultDiagnosticsDefault Diagnostics level for SQL performance tracking (Default: Off)
DefaultGracefulReaderShutdownThe default value for handling open Readers when a database Connection instance is closed (Default: true)
DefaultIndexFillFactorDefault Fill Factor used when creating an index with an unspecified Fill Factor (Default: 85)
DefaultLogConfigDefault logging configuration for a database connection
DefaultTableInfoOptionsDefault values for deriving TableInfo from a Type
ExposeConnectionStringsThe value for deciding if ConnectionStrings are exposed on Connection instances (Default: false)
LockEntranceTimeoutTimeout when entering a lock (specified in milliseconds, default: 3000)
LogFactoryOptional library-wide logger factory for JASE.Database sessions.
MemoryCachePercentReturns the percentage of memory (Default: 5%)
NamingStrategySpecifies the naming strategy to use when generating SQL (default: snake_case).
PostgreSqlConnectionDefaultsDefault values for a generated PostgreSQL Connection String
PostgreSqlDefaultSslModeValue for SSL Mode key in a generated PostgreSQL connection string (Default: Prefer).
PostgreSqlGeneratorDefaultsDefault values for a PostgreSQL Generator
PostgreSqlStatTupleInstalledIndicates install status of PostgreSql extention pgstattuple
PrettyIndentIndentation used for PrettySQl (Default: 4 spaces)
PrettySQLGenerate more readable SQL statements (Default: true)
PrimaryJoinAliasTable alias used for the PRIMARY table in a JOIN operation (Default: PRIMARYTABLE)
ReservedMemoryCacheBytesReturns the number of bytes that should be reserved for MemoryCache
SqlServerConnectionDefaultsDefault values for a generated SQL Server Connection String
SqlServerGeneratorDefaultsDefault values for a SQL Server Generator
SqlServerTrustServerCertificateTrust the SQL Server's certificate, even if it's self-signed or not issued by a trusted Certificate Authority (CA) (Default: false)
TableInfoCacheDurationTimeSpan reprensting how long TableInfo data should be retained in memory cache (Default: 60 minutes)

Methods ​

NameDescription
void SetApplicationName(string value)Set the value for ApplicationName property
void SetCacheMode(CacheMode cacheMode)Sets the value CacheMode
bool SetCommandHistoryMaxSize(int value)Set the value for MaxCommandHistorySize Must be a non-negative number and less than
void SetDefaultCharacterMaxLength(int value)Set the value for DefaultCharacterMaxLength
void SetDefaultCommandHistoryTracking(bool value)Set the value for DefaultCommandHistoryTracking
void SetDefaultCommandTimeout(int value)Set the value for DefaultCommandTimeout
void SetDefaultDiagnostics(Diagnostics level)Set the value for DefaultDiagnostics
void SetDefaultGracefulReaderShutdown(bool value)Set the value for DefaultGracefulReaderShutdown
bool SetDefaultIndexFillFactor(int value)Sets the global default fill factor to be used when creating indexes, including auto-increment column indexes, if no specific value is set. DefaultIndexFillFactor
void SetDefaultTableInfoOptions(TableInfoOptions options)Set the value for DefaultTableInfoOptions
void SetExposeConnectionStrings(bool value)Set the value for ExposeConnectionStrings
bool SetLockEntranceTimeout(int value)Sets the lock entrance timeout in milliseconds. Must be non-negative.
void SetLogFactory(ILoggerFactory factory)Sets the library-wide logger factory for JASE.Database.
bool SetMemoryCachePercent(int value)Sets the value for MemoryCachePercent. Must be in the range of 1-50.
bool SetNamingStrategy(NamingStrategy value)Sets the value for NamingStrategy - Also updates NamingStrategy default for built-in generators
void SetPostgreSqlConnectionDefaults(string defaults)Set the values for PostgreSqlConnectionDefaults
void SetPostgreSqlDefaultSslMode(PostgreSqlSslMode mode)Sets PostgreSqlDefaultSslMode and keeps PostgreSqlConnectionDefaults in sync when that defaults dictionary already contains an SSL Mode entry.
void SetPostgreSqlGeneratorDefaults(PostgreSqlGeneratorOptions options)Sets the value for PostgreSqlGeneratorDefaults
void SetPostgreSqlStatTupleInstalled(bool value)Set the value for PostgreSqlStatTupleInstalled
void SetPrettySQL(bool value)Sets the value for PrettySQL
void SetPrimaryJoinAlias(string alias)Sets the value for PrimaryJoinAlias
void SetSqlServerConnectionDefaults(string defaults)Set the values for SqlServerConnectionDefaults
void SetSqlServerGeneratorDefaults(SqlServerGeneratorOptions options)Set the value for SqlServerGeneratorDefaults
void SetSqlServerTrustServerCertificate(bool value)Set the value for SqlServerTrustServerCertificate
bool SetTableInfoCacheDuration(int minutes)Update the TableInfoCacheDuration based on the number of minutes. Must be in the range of 1-10,080 (1 week)