chore: split DAL into two packages, with moduleconfig queries moved to common/configuration #1840
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1696
Approach:
- engine
block ofsqlc.yaml
to support multipleout
locationsdalerrs
package. This now lives under the new top leveldb
dir, where we can add additional common DB logic as we split the controller dal further. This change incurred a lot of NOOP lines changed. :/backend/controller/sql
and intocommon/configuration/sql
. Correspondingly, split the moduleconfig DAL functions out ofbackend/controller/dal
and intocommon/configuration/dal
.backend/controller/sql/conn.go
tocommon/configuration/sql/conn.go
with the unnecessary logic stripped out (Tx
...). That means that what remains (sql.DBI
andsql.NewDB
), though a small amount of code, is duplicated with the originalconn.go
. I could refactor this to use a shared interface instead, but that could also make this messier for readability and take things in a worse direction overall, so pending better ideas, we can rethink this when splitting the controller DAL.