Add saved query management functions.#191
Conversation
Linter didn't like:
```
> src/cb/saved_query.cr:95:29
> [W] Lint/NotNil: Avoid using `not_nil!`
> > name: @name.not_nil!,
```
So removed the `not_nil!`. It is now consistent with other
functions in the existing code base by not type-annotating
client method parameters
|
Tried a 3-phased approach to this PR with checkpoints that I could review. I also found that it made the process repeatable on a fresh branch.
Once artifacts were generated, started a new session and asked Claude to implement changes. Everything generated/passed on the first pass, save for the linter error. |
sfc-gh-abrightwell
left a comment
There was a problem hiding this comment.
LGTM. Just a few comments.
| CB::Model::SavedQuery.from_json resp.body | ||
| end | ||
|
|
||
| def create_saved_query(params) |
There was a problem hiding this comment.
It might be worth definite a param type for the create method. As I think that leaving it unbounded chokes spectator when generating the mock client. Or at least that's one thing I feel like eased the CI failures a little that I was debugging in #192.
struct SavedQueryCreateParams
include JSON::Serializable
property cluster_id : String?
property name : String?
property sql : String?
property? skip_enqueue : Bool = true
def initialize(@cluster_id, @name, @sql, @skip_enqueue = true)
end
end
def create_saved_query(params : SavedQueryCreateParams)
resp = post "saved-queries", params
CB::Model::SavedQuery.from_json resp.body
end
No description provided.