-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: State add flush and fix migration bug #1039
Conversation
@@ -158,5 +160,5 @@ func (c *Client) GetKey(_ context.Context, key string) (string, error) { | |||
if val, ok := c.mem[key]; ok { | |||
return val, nil | |||
} | |||
return "", fmt.Errorf("key not found") | |||
return "", nil |
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 decided to return ""
if not found but we can later on make this an option which the user can decide if they want to use ""
or NotFoundErr
@@ -14,6 +14,7 @@ import ( | |||
type Client interface { | |||
SetKey(ctx context.Context, key string, value string) error | |||
GetKey(ctx context.Context, key string) (string, error) | |||
Flush(ctx context.Context) 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.
What's flush for?
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.
It is not flushing the content every Set
otherwise data is not written back. It is already implemented on the state
implementation but just wasn't exposed
🤖 I have created a release *beep* *boop* --- ## [4.4.1-rc1](v4.4.0-rc1...v4.4.1-rc1) (2023-07-01) ### Bug Fixes * **deps:** Update github.com/apache/arrow/go/v13 digest to 5a06b2e ([#1032](#1032)) ([d369262](d369262)) * **deps:** Update golang.org/x/exp digest to 97b1e66 ([#1033](#1033)) ([791e60a](791e60a)) * **deps:** Update google.golang.org/genproto/googleapis/rpc digest to 9506855 ([#1034](#1034)) ([6999d11](6999d11)) * **deps:** Update module github.com/goccy/go-json to v0.10.2 ([#1035](#1035)) ([521eb13](521eb13)) * **deps:** Update module github.com/klauspost/compress to v1.16.6 ([#1036](#1036)) ([76bfc85](76bfc85)) * **serve:** Confusing message ([#1031](#1031)) ([ee873c9](ee873c9)) * State add flush and fix migration bug ([#1039](#1039)) ([8c10291](8c10291)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This fixes a bug in state backend where table weren't created.
I also tested it with cloudquery/cloudquery#11855 which seems to work with minor modifications (will open a PR shortly to the CLI PR)