Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 2.37 KB

File metadata and controls

71 lines (45 loc) · 2.37 KB

Akka.Persistence.PostgreSql.Hosting

Akka.Hosting extension methods to add Akka.Persistence.PostgreSql to an ActorSystem

Akka.Persistence.PostgreSql Extension Methods

WithPostgreSqlPersistence() Method

public static AkkaConfigurationBuilder WithPostgreSqlPersistence(
    this AkkaConfigurationBuilder builder,
    string connectionString,
    PersistenceMode mode = PersistenceMode.Both,
    string schemaName = "public",
    bool autoInitialize = false,
    StoredAsType storedAsType = StoredAsType.ByteA,
    bool sequentialAccess = false,
    bool useBigintIdentityForOrderingColumn = false, 
    Action<AkkaPersistenceJournalBuilder> configurator = null);

Parameters

  • connectionString string

    Connection string used for database access.

  • mode PersistenceMode

    Determines which settings should be added by this method call. Default: PersistenceMode.Both

    • PersistenceMode.Journal: Only add the journal settings
    • PersistenceMode.SnapshotStore: Only add the snapshot store settings
    • PersistenceMode.Both: Add both journal and snapshot store settings
  • schemaName string

    The schema name for the journal and snapshot store table. Default: "public"

  • autoInitialize bool

    Should the SQL store table be initialized automatically. Default: false

  • storedAsType StoredAsType

    Determines how data are being de/serialized into the table. Default: StoredAsType.ByteA

    • StoredAsType.ByteA: Byte array
    • StoredAsType.Json: JSON
    • StoredAsType.JsonB: Binary JSON
  • sequentialAccess bool

    Uses the CommandBehavior.SequentialAccess when creating SQL commands, providing a performance improvement for reading large BLOBS. Default: false

  • useBigintIdentityForOrderingColumn bool

    When set to true, persistence will use BIGINT and GENERATED ALWAYS AS IDENTITY for journal table schema creation. Default: false

    NOTE

    This only affects newly created tables, as such, it should not affect any existing database.

    WARNING

    To use this feature, you have to have PorsgreSql version 10 or above

  • configurator Action<AkkaPersistenceJournalBuilder>

    An Action delegate used to configure an AkkaPersistenceJournalBuilder instance. Used to configure Event Adapters