Skip to content

Conversation

@yevgenypats
Copy link
Contributor

@yevgenypats yevgenypats commented Jul 1, 2023

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)

return val, nil
}
return "", fmt.Errorf("key not found")
return "", nil
Copy link
Contributor Author

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

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's flush for?

Copy link
Contributor Author

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

@yevgenypats yevgenypats requested a review from disq July 1, 2023 16:44
@yevgenypats yevgenypats merged commit 8c10291 into main Jul 1, 2023
@yevgenypats yevgenypats deleted the fix/state branch July 1, 2023 16:45
kodiakhq bot pushed a commit that referenced this pull request Jul 1, 2023
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants