Skip to content

Commit

Permalink
Updated transaction APIs to return boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
akclace committed Feb 29, 2024
1 parent 6447af1 commit fb2cfb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/app/store/store_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (s *storePlugin) Begin(thread *starlark.Thread, builtin *starlark.Builtin,
}
app.SavePluginState(thread, TRANSACTION_KEY, tx)
app.DeferCleanup(thread, fmt.Sprintf("transaction_%p", tx), tx.Rollback, false)
return app.NewResponse(tx), nil
return app.NewResponse(true), nil
}

func (s *storePlugin) Commit(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
Expand All @@ -81,7 +81,7 @@ func (s *storePlugin) Commit(thread *starlark.Thread, builtin *starlark.Builtin,
if err != nil {
return nil, err
}
return app.NewResponse(tx), nil
return app.NewResponse(true), nil
}

func (s *storePlugin) Rollback(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
Expand All @@ -97,7 +97,7 @@ func (s *storePlugin) Rollback(thread *starlark.Thread, builtin *starlark.Builti
if err != nil {
return nil, err
}
return app.NewResponse(tx), nil
return app.NewResponse(true), nil
}

func (s *storePlugin) Insert(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
Expand Down

0 comments on commit fb2cfb0

Please sign in to comment.