Documentation
¶
Overview ¶
Package adapters provide database adapter implementations for the PostgreSQL event store.
This package implements the adapter pattern to support multiple PostgreSQL database libraries: pgx.Pool, sql.DB, and sqlx.DB. All adapters provide equivalent functionality through a common DBAdapter interface, allowing the event store to work seamlessly with any supported database connection type.
The adapters handle the specifics of each database library while presenting a unified interface for query execution and result handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBAdapter ¶
type DBAdapter interface { Query(ctx context.Context, query string) (DBRows, error) Exec(ctx context.Context, query string) (DBResult, error) }
DBAdapter defines the interface for database operations needed by the event store
type PGXAdapter ¶
type PGXAdapter struct {
// contains filtered or unexported fields
}
PGXAdapter implements DBAdapter for pgxpool.Pool
func NewPGXAdapter ¶
func NewPGXAdapter(pool *pgxpool.Pool) *PGXAdapter
NewPGXAdapter creates a new PGX adapter
type SQLAdapter ¶
type SQLAdapter struct {
// contains filtered or unexported fields
}
SQLAdapter implements DBAdapter for sql.DB
func NewSQLAdapter ¶
func NewSQLAdapter(db *sql.DB) *SQLAdapter
NewSQLAdapter creates a new SQL adapter
type SQLXAdapter ¶
type SQLXAdapter struct {
// contains filtered or unexported fields
}
SQLXAdapter implements DBAdapter for sqlx.DB
func NewSQLXAdapter ¶
func NewSQLXAdapter(db *sqlx.DB) *SQLXAdapter
NewSQLXAdapter creates a new SQLX adapter