Categorygithub.com/tochemey/protoactor-persistence-sql
modulepackage
0.0.0-20221216101051-0f7058278040
Repository: https://github.com/tochemey/protoactor-persistence-sql.git
Documentation: pkg.go.dev

# README

ProtoActor Persistence SQL

Codacy grade GitHub Workflow Status (branch) Codecov

An implementation of the ProtoActor persistence plugin APIs using RDBMS. It writes journal and snapshot to a configured SQL datastore. At the moment the following data stores are supported out of the box:

The events and state snapshots are protocol buffer bytes array persisted respectively in the journal and snapshot tables.

Note: The developer does not need to create the database tables. They are created by default by the library. One can have a look at them in the constants.go code.

# Functions

NewDBConfig creates an instance of DBConfig.
NewDialect creates a new instance of SQLDialect.
NewJournal creates a new instance of Snapshot.
NewMySQLDialect creates a new instance of SQLDialect.
NewMySQLProvider creates an instance postgres base SQLProvider.
NewPostgresDialect creates a new instance of SQLDialect.
NewPostgresProvider creates an instance postgres base SQLProvider.
NewSnapshot creates a new instance of Snapshot.
NewSQLProvider creates a new instance of the SQLProvider.
WithConnectionMaxLife sets the database connection max life.
WithLogicalDeletion enables logical deletion.
WithMaxIdleConnections sets the max idle connections.
WithMaxOpenConnections sets the max open connections.
WithSnapshotInterval sets the snapshot interval.

# Constants

MYSQL driver type.
POSTGRES driver type.

# Structs

DBConfig represents the database configuration.
Journal defines the journal row.
Snapshot defines the snapshot row.
SQLProvider defines a generic persistence provider.
SQLProviderState is an implementation of the proto-actor ProviderState interface.

# Interfaces

SQLDialect will be implemented any database dialect.

# Type aliases

Driver defines a type of SQL driver accepted.
No description provided by the author
No description provided by the author
PoolOpt defines the connection pool options.