Akka.Hosting extension methods to add Akka.Persistence.PostgreSql to an ActorSystem
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);-
connectionStringstringConnection string used for database access.
-
modePersistenceModeDetermines which settings should be added by this method call. Default:
PersistenceMode.BothPersistenceMode.Journal: Only add the journal settingsPersistenceMode.SnapshotStore: Only add the snapshot store settingsPersistenceMode.Both: Add both journal and snapshot store settings
-
schemaNamestringThe schema name for the journal and snapshot store table. Default:
"public" -
autoInitializeboolShould the SQL store table be initialized automatically. Default:
false -
storedAsTypeStoredAsTypeDetermines how data are being de/serialized into the table. Default:
StoredAsType.ByteAStoredAsType.ByteA: Byte arrayStoredAsType.Json: JSONStoredAsType.JsonB: Binary JSON
-
sequentialAccessboolUses the
CommandBehavior.SequentialAccesswhen creating SQL commands, providing a performance improvement for reading large BLOBS. Default:false -
useBigintIdentityForOrderingColumnboolWhen set to true, persistence will use
BIGINTandGENERATED ALWAYS AS IDENTITYfor journal table schema creation. Default: falseNOTE
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
-
configuratorAction<AkkaPersistenceJournalBuilder>An Action delegate used to configure an
AkkaPersistenceJournalBuilderinstance. Used to configure Event Adapters