logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class StructuredBackendConsumerProfile

    Describes everything consumer-specific about constructing structured stores from the shared backend assets, so StructuredBackendStores can build stores for any consumer (structured logging, leaderboard, future ones) with zero consumer knowledge of its own: warning identity, the key-value partition field, local-storage defaults, the optional SQLite first-use schema, and the per-store serializers.

    Inheritance
    object
    StructuredBackendConsumerProfile
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.StructuredPersistence.Backends
    Assembly: Serenity.UnityStructuredPersistence.Backends.dll
    Syntax
    public sealed class StructuredBackendConsumerProfile

    Constructors

    StructuredBackendConsumerProfile(string, string, string, string, string, string, string, string, string, Func<StoreTable, StructuredTableSchema>, Func<ISerializer<StructuredRecord[]>>, Func<ISerializer<StructuredRecord[]>>)

    Creates a new consumer profile. Every parameter except sqliteSchemaFactory is required.

    Declaration
    public StructuredBackendConsumerProfile(string logPrefix, string logCategory, string fallbackDescription, string partitionField, string playerPrefsNamespace, string defaultLocalFileDirectoryName, string localFileAtomicWriterId, string localFileExtension, string defaultSqliteDatabaseFileName, Func<StoreTable, StructuredTableSchema> sqliteSchemaFactory, Func<ISerializer<StructuredRecord[]>> playerPrefsSerializerFactory, Func<ISerializer<StructuredRecord[]>> localFileSerializerFactory)
    Parameters
    Type Name Description
    string logPrefix
    string logCategory
    string fallbackDescription
    string partitionField
    string playerPrefsNamespace
    string defaultLocalFileDirectoryName
    string localFileAtomicWriterId
    string localFileExtension
    string defaultSqliteDatabaseFileName
    Func<StoreTable, StructuredTableSchema> sqliteSchemaFactory
    Func<ISerializer<StructuredRecord[]>> playerPrefsSerializerFactory
    Func<ISerializer<StructuredRecord[]>> localFileSerializerFactory

    Properties

    DefaultLocalFileDirectoryName

    Declaration
    public string DefaultLocalFileDirectoryName { get; }
    Property Value
    Type Description
    string

    Directory under Application.persistentDataPath used when the LocalFile asset is null or its DirectoryName is blank.

    DefaultSqliteDatabaseFileName

    Declaration
    public string DefaultSqliteDatabaseFileName { get; }
    Property Value
    Type Description
    string

    File name under Application.persistentDataPath used when the Sqlite asset's DatabaseFileName is blank.

    FallbackDescription

    Declaration
    public string FallbackDescription { get; }
    Property Value
    Type Description
    string

    The consumer's fallback backend name as spoken in warnings, e.g. "PlayerPrefs" ("Falling back to the {X} backend.").

    LocalFileAtomicWriterId

    Declaration
    public string LocalFileAtomicWriterId { get; }
    Property Value
    Type Description
    string

    Identifier stamped on the LocalFile backend's atomic file writer.

    LocalFileExtension

    Declaration
    public string LocalFileExtension { get; }
    Property Value
    Type Description
    string

    File extension (with leading dot) of the LocalFile backend's partition files, matching LocalFileSerializerFactory's format.

    LocalFileSerializerFactory

    Declaration
    public Func<ISerializer<StructuredRecord[]>> LocalFileSerializerFactory { get; }
    Property Value
    Type Description
    Func<ISerializer<StructuredRecord[]>>

    Creates the serializer the LocalFile key-value store encodes partition files with.

    LogCategory

    Declaration
    public string LogCategory { get; }
    Property Value
    Type Description
    string

    Log category every warning is reported under, e.g. "LeaderboardBackendFactory".

    LogPrefix

    Declaration
    public string LogPrefix { get; }
    Property Value
    Type Description
    string

    Prefix opening every warning message, e.g. "[Leaderboard]".

    PartitionField

    Declaration
    public string PartitionField { get; }
    Property Value
    Type Description
    string

    The field every key-value-backed store partitions records by (required as an Equal filter on every query/trim).

    PlayerPrefsNamespace

    Declaration
    public string PlayerPrefsNamespace { get; }
    Property Value
    Type Description
    string

    Diagnostic namespace of the consumer's PlayerPrefs key-value store.

    PlayerPrefsSerializerFactory

    Declaration
    public Func<ISerializer<StructuredRecord[]>> PlayerPrefsSerializerFactory { get; }
    Property Value
    Type Description
    Func<ISerializer<StructuredRecord[]>>

    Creates the serializer the PlayerPrefs key-value store encodes partitions with.

    SqliteSchemaFactory

    Declaration
    public Func<StoreTable, StructuredTableSchema> SqliteSchemaFactory { get; }
    Property Value
    Type Description
    Func<StoreTable, StructuredTableSchema>

    Builds the consumer's table schema for the Sqlite backend's ensure-on-first-use wrap, or null to hand back the raw store without the wrap (server-database-style manual provisioning).

    In this article
    © 2026 Serenity. All Rights Reserved