Skip to content

Commit

Permalink
refactor: make encryption/dal internal (#2769)
Browse files Browse the repository at this point in the history
This continues the service split refactoring.
  • Loading branch information
alecthomas authored Sep 23, 2024
1 parent 9df10ca commit cab56b0
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import (
"fmt"

"github.com/TBD54566975/ftl/backend/controller/encryption/api"
"github.com/TBD54566975/ftl/backend/controller/encryption/dal/internal/sql"
encryptionsql "github.com/TBD54566975/ftl/backend/controller/encryption/internal/sql"
"github.com/TBD54566975/ftl/backend/libdal"
"github.com/TBD54566975/ftl/internal/log"
)

type DAL struct {
*libdal.Handle[DAL]
db sql.Querier
db encryptionsql.Querier
}

func New(ctx context.Context, conn libdal.Connection) *DAL {
return &DAL{
Handle: libdal.New(conn, func(h *libdal.Handle[DAL]) *DAL {
return &DAL{
Handle: h,
db: sql.New(h.Connection),
db: encryptionsql.New(h.Connection),
}
}),
db: sql.New(conn),
db: encryptionsql.New(conn),
}
}

Expand Down
2 changes: 1 addition & 1 deletion backend/controller/encryption/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/alecthomas/types/optional"

"github.com/TBD54566975/ftl/backend/controller/encryption/api"
"github.com/TBD54566975/ftl/backend/controller/encryption/dal"
"github.com/TBD54566975/ftl/backend/controller/encryption/internal/dal"
"github.com/TBD54566975/ftl/backend/libdal"
)

Expand Down
4 changes: 2 additions & 2 deletions sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ sql:
out: "backend/controller/leases/dal/internal/sql"
- <<: *daldir
queries:
- backend/controller/encryption/dal/internal/sql/queries.sql
- backend/controller/encryption/internal/sql/queries.sql
gen:
go:
<<: *gengo
out: "backend/controller/encryption/dal/internal/sql"
out: "backend/controller/encryption/internal/sql"
- <<: *daldir
queries:
- backend/controller/timeline/internal/sql/queries.sql
Expand Down

0 comments on commit cab56b0

Please sign in to comment.