mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2024-11-22 14:16:47 +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,
|
||
|
}
|
||
|
}
|