mirror of
https://github.com/hanzo-fi/webhooks.git
synced 2026-10-30 20:32:55 +00:00
20 lines
416 B
Go
20 lines
416 B
Go
package postgres
|
|
|
|
import (
|
|
"github.com/uptrace/bun"
|
|
|
|
"github.com/formancehq/go-libs/v2/bun/bunconnect"
|
|
|
|
"github.com/formancehq/webhooks/pkg/storage"
|
|
"go.uber.org/fx"
|
|
)
|
|
|
|
func NewModule(connectionOptions bunconnect.ConnectionOptions, debug bool) fx.Option {
|
|
return fx.Options(
|
|
bunconnect.Module(connectionOptions, debug),
|
|
fx.Provide(func(db *bun.DB) (storage.Store, error) {
|
|
return NewStore(db)
|
|
}),
|
|
)
|
|
}
|