Skip to content

Commit 4e4d3d2

Browse files
committed
update store based on new speculation tree entity
1 parent db4d7da commit 4e4d3d2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎extension/storage/mysql/speculation_tree_store.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ func (s *speculationTreeStore) Get(ctx context.Context, batchID string) (entity.
2828
var speculationsJSON []byte
2929

3030
err := s.db.QueryRowContext(ctx,
31-
"SELECT batch_id, queue, speculations FROM speculation_tree WHERE batch_id = ?",
31+
"SELECT batch_id, speculations FROM speculation_tree WHERE batch_id = ?",
3232
batchID,
33-
).Scan(&st.BatchID, &st.Queue, &speculationsJSON)
33+
).Scan(&st.BatchID, &speculationsJSON)
3434

3535
if errors.Is(err, sql.ErrNoRows) {
3636
return entity.SpeculationTree{}, storage.WrapNotFound(err)
@@ -54,8 +54,8 @@ func (s *speculationTreeStore) Create(ctx context.Context, speculationTree entit
5454
}
5555

5656
_, err = s.db.ExecContext(ctx,
57-
"INSERT INTO speculation_tree (batch_id, queue, speculations) VALUES (?, ?, ?)",
58-
speculationTree.BatchID, speculationTree.Queue, speculationsJSON,
57+
"INSERT INTO speculation_tree (batch_id, speculations) VALUES (?, ?)",
58+
speculationTree.BatchID, speculationsJSON,
5959
)
6060
if err != nil {
6161
var mysqlErr *mysql.MySQLError
@@ -69,7 +69,7 @@ func (s *speculationTreeStore) Create(ctx context.Context, speculationTree entit
6969
}
7070

7171
// UpdateSpeculations updates the speculations of a speculation tree. Returns ErrNotFound if the speculation tree is not found.
72-
func (s *speculationTreeStore) UpdateSpeculations(ctx context.Context, batchID string, speculations []map[string]string) error {
72+
func (s *speculationTreeStore) UpdateSpeculations(ctx context.Context, batchID string, speculations []entity.SpeculationInfo) error {
7373
speculationsJSON, err := json.Marshal(speculations)
7474
if err != nil {
7575
return fmt.Errorf("failed to marshal speculations batchID=%s for UpdateSpeculations: %w", batchID, err)

‎extension/storage/speculation_tree_store.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ type SpeculationTreeStore interface {
1818

1919
// UpdateSpeculations updates the speculations of a speculation tree.
2020
// Returns ErrNotFound if the speculation tree is not found.
21-
UpdateSpeculations(ctx context.Context, batchID string, speculations []map[string]string) error
21+
UpdateSpeculations(ctx context.Context, batchID string, speculations []entity.SpeculationInfo) error
2222
}

0 commit comments

Comments
 (0)