-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add saga persistence layer #649
Conversation
db *sql.DB | ||
} | ||
|
||
func SelectOne[T any](db *sql.DB, sql string, fn ScanRows[T], args ...any) (T, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generics are also used here, need to remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we can keep this generic function. It maps the Rows
to arbitrary type T
, which I think it is a good abstract in my POV. If not using generics, we can only change the return type to interface{}
, and use type conversion db.SelectOne(...).(StateMachineInstance)
at the invocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some conflicts, please resolve.
…a-db # Conflicts: # pkg/saga/statemachine/constant/contant.go
What this PR does:
This PR involves the storage aspect of the state machine. The primary focus will be on creating SQL templates, with reference to the seata-engine-store module.
Which issue(s) this PR fixes:
Fixes #638
Special notes for your reviewer:
UTs are under the same directory as sources