logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityDatabaseBackendDefinition

    Abstract intermediate base for the server database structured-store backends (Postgres/MySql/Mongo), which share the same discrete connection fields, the same connection-string override, and the same environment-variable override mechanism.

    Inheritance
    object
    UnityStructuredBackendDefinition
    UnityDatabaseBackendDefinition
    UnityMongoBackendDefinition
    UnityMySqlBackendDefinition
    UnityPostgresBackendDefinition
    Implements
    IFoundationSettings
    Inherited Members
    UnityStructuredBackendDefinition.Id
    UnityStructuredBackendDefinition.Guid
    Namespace: Serenity.StructuredPersistence.Infrastructure.Settings
    Assembly: Serenity.UnityStructuredPersistence.Infrastructure.dll
    Syntax
    public abstract class UnityDatabaseBackendDefinition : UnityStructuredBackendDefinition, IFoundationSettings

    Constructors

    UnityDatabaseBackendDefinition()

    Declaration
    protected UnityDatabaseBackendDefinition()

    Fields

    ConnectionStringOverride

    Declaration
    public string ConnectionStringOverride
    Field Value
    Type Description
    string

    Full connection string, overriding Host/Port/Database/ Username/Password when non-empty.

    Database

    Declaration
    public string Database
    Field Value
    Type Description
    string

    Database name.

    EnvironmentVariableOverridePrefix

    Declaration
    public string EnvironmentVariableOverridePrefix
    Field Value
    Type Description
    string

    Prefix used to look up credential overrides (Password, connection fields) from environment variables at runtime instead of the serialized asset values. Empty means no override.

    Host

    Declaration
    public string Host
    Field Value
    Type Description
    string

    Database host.

    Password

    Declaration
    public string Password
    Field Value
    Type Description
    string

    Database password.

    Remarks

    A value entered here is serialized into the asset and shipped inside the build — never store a production secret here. Prefer EnvironmentVariableOverridePrefix so the real password is injected from the environment at runtime instead.

    Port

    Declaration
    public int Port
    Field Value
    Type Description
    int

    Database port. Zero falls back to the database's default port.

    TimeoutSeconds

    Declaration
    public int TimeoutSeconds
    Field Value
    Type Description
    int

    Network timeout, in seconds, applied to database calls.

    Username

    Declaration
    public string Username
    Field Value
    Type Description
    string

    Database username.

    Implements

    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved