mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2024-12-23 10:17:32 +01:00
26 lines
411 B
Go
26 lines
411 B
Go
|
package store
|
||
|
|
||
|
import (
|
||
|
"github.com/grassrootseconomics/cic-custodial/internal/queries"
|
||
|
"github.com/jackc/pgx/v5/pgxpool"
|
||
|
)
|
||
|
|
||
|
type (
|
||
|
Opts struct {
|
||
|
PostgresPool *pgxpool.Pool
|
||
|
Queries *queries.Queries
|
||
|
}
|
||
|
|
||
|
PostgresStore struct {
|
||
|
db *pgxpool.Pool
|
||
|
queries *queries.Queries
|
||
|
}
|
||
|
)
|
||
|
|
||
|
func NewPostgresStore(o Opts) Store {
|
||
|
return &PostgresStore{
|
||
|
db: o.PostgresPool,
|
||
|
queries: o.Queries,
|
||
|
}
|
||
|
}
|