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);
-
connectionString
stringConnection string used for database access.
-
mode
PersistenceModeDetermines which settings should be added by this method call. Default:
PersistenceMode.Both
PersistenceMode.Journal
: Only add the journal settingsPersistenceMode.SnapshotStore
: Only add the snapshot store settingsPersistenceMode.Both
: Add both journal and snapshot store settings
-
schemaName
stringThe schema name for the journal and snapshot store table. Default:
"public"
-
autoInitialize
boolShould the SQL store table be initialized automatically. Default:
false
-
storedAsType
StoredAsTypeDetermines how data are being de/serialized into the table. Default:
StoredAsType.ByteA
StoredAsType.ByteA
: Byte arrayStoredAsType.Json
: JSONStoredAsType.JsonB
: Binary JSON
-
sequentialAccess
boolUses the
CommandBehavior.SequentialAccess
when creating SQL commands, providing a performance improvement for reading large BLOBS. Default:false
-
useBigintIdentityForOrderingColumn
boolWhen set to true, persistence will use
BIGINT
andGENERATED ALWAYS AS IDENTITY
for 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
-
configurator
Action<AkkaPersistenceJournalBuilder>An Action delegate used to configure an
AkkaPersistenceJournalBuilder
instance. Used to configure Event Adapters