Initial project structure commit.
Static directory for public folders and business logic for the app within internal, split into domain specific folders to keep clear seperation of concerns.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
type Store struct {
|
||||
// embedded field, for easier access ie store.GetUser
|
||||
*Queries
|
||||
// named field for explicit calles ie db.Begin
|
||||
db *pgxpool.Pool
|
||||
}
|
||||
|
||||
func NewStore(db *pgxpool.Pool) *Store {
|
||||
return &Store{
|
||||
Queries: New(db),
|
||||
db: db,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user