feat: 0.0.1
This commit is contained in:
146 files changed
+10444
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
type Store interface {
|
||||
Querier
|
||||
CreateUserTx(ctx context.Context, arg CreateUserTxParams) (CreateUserTxResult, error)
|
||||
VerifyEmailTx(ctx context.Context, arg VerifyEmailTxParams) (VerifyEmailTxResult, error)
|
||||
}
|
||||
|
||||
// PostgresStore provides all functions to execute db queries and transactions
|
||||
type PostgresStore struct {
|
||||
*Queries
|
||||
connPool *pgxpool.Pool
|
||||
}
|
||||
|
||||
// NewPostgresStore creates a new Store
|
||||
func NewPostgresStore(connPool *pgxpool.Pool) Store {
|
||||
return &PostgresStore{
|
||||
connPool: connPool,
|
||||
Queries: New(connPool),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user