sql: Refactor use of tables
This commit is contained in:
parent
85fe5b5c5a
commit
73d821e320
19 changed files with 191 additions and 83 deletions
|
|
@ -3,7 +3,6 @@ package bookkeeping
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
)
|
||||
|
||||
|
|
@ -14,7 +13,7 @@ type Bookkeeping struct {
|
|||
|
||||
// Save saves this instance in the bookkeeping table
|
||||
func (bk *Bookkeeping) Save(ctx context.Context) error {
|
||||
sdb, err := bk.Malt.SQL.QueryTable(ctx, false, models.InstanceTable)
|
||||
sdb, err := bk.Malt.SQL.QueryTable(ctx, bk.Malt.InstanceTable)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -30,7 +29,7 @@ func (bk *Bookkeeping) Save(ctx context.Context) error {
|
|||
|
||||
// Delete deletes this instance from the bookkeeping table
|
||||
func (bk *Bookkeeping) Delete(ctx context.Context) error {
|
||||
sdb, err := bk.Malt.SQL.QueryTable(ctx, false, models.InstanceTable)
|
||||
sdb, err := bk.Malt.SQL.QueryTable(ctx, bk.Malt.InstanceTable)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue