Skip to content

(Re)Implement QueryJSON as iter.Seq[NextMessage]#531

Merged
radeksimko merged 3 commits intopre-releasefrom
radek/f-query-log-emitter
Sep 16, 2025
Merged

(Re)Implement QueryJSON as iter.Seq[NextMessage]#531
radeksimko merged 3 commits intopre-releasefrom
radek/f-query-log-emitter

Conversation

@radeksimko
Copy link
Copy Markdown
Member

@radeksimko radeksimko commented Aug 18, 2025

Example Usage

iter, err := tf.QueryJSON(context.Background())
if err != nil {
	t.Fatalf("error running Query: %s", err)
}

for nextMsg := range iter {
	if nextMsg.Err != nil {
		// handle error
		break
	}
	switch m := nextMsg.Msg.(type) {
	case tfjson.ListStartMessage:
		// do something
	case tfjson.ListResourceFoundMessage:
		// do something
	case tfjson.ListCompleteMessage:
		// do something
	}
}

@radeksimko radeksimko changed the title (Re)Implement QueryJSON as LogMsg emitter (Re)Implement QueryJSON as LogMsg emitter Aug 18, 2025
@SBGoods

This comment was marked as outdated.

@radeksimko

This comment was marked as outdated.

@radeksimko radeksimko force-pushed the radek/f-query-log-emitter branch from b3bfedb to ca4fa35 Compare September 3, 2025 11:41
@hashicorp-cla-app
Copy link
Copy Markdown

hashicorp-cla-app bot commented Sep 3, 2025

CLA assistant check
All committers have signed the CLA.

@radeksimko radeksimko force-pushed the radek/f-query-log-emitter branch from ca4fa35 to 9a8d530 Compare September 3, 2025 11:46
@radeksimko radeksimko force-pushed the radek/f-query-log-emitter branch 4 times, most recently from ff3f3e6 to c05687b Compare September 3, 2025 14:39
@radeksimko radeksimko force-pushed the radek/f-query-log-emitter branch from 4ac3e4d to 4b8c035 Compare September 16, 2025 13:19
@radeksimko radeksimko force-pushed the radek/f-query-log-emitter branch from 77b8c83 to 9793bd2 Compare September 16, 2025 15:01
@radeksimko radeksimko marked this pull request as ready for review September 16, 2025 15:24
@radeksimko radeksimko requested review from a team as code owners September 16, 2025 15:24
Copy link
Copy Markdown
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

I've left a nit and question about testing, however I'm happy for this to be merged and have these addressed later if that's necessary.

@SarahFrench
Copy link
Copy Markdown
Member

Also, @radeksimko could you please update the PR title to reflect the latest changes?

@radeksimko radeksimko changed the title (Re)Implement QueryJSON as LogMsg emitter (Re)Implement QueryJSON as iter.Seq Sep 16, 2025
@radeksimko radeksimko changed the title (Re)Implement QueryJSON as iter.Seq (Re)Implement QueryJSON as iter.Seq[NextMessage] Sep 16, 2025
Co-authored-by: Sarah French <[email protected]>
@radeksimko radeksimko merged commit aef6e4e into pre-release Sep 16, 2025
107 checks passed
@radeksimko radeksimko deleted the radek/f-query-log-emitter branch September 16, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants