Skip to content
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

Use generics #129

Open
dcu opened this issue Aug 16, 2023 · 2 comments
Open

Use generics #129

dcu opened this issue Aug 16, 2023 · 2 comments
Assignees

Comments

@dcu
Copy link

dcu commented Aug 16, 2023

I believe this library would benefit a lot from generics, for example for the Query() operation

@pmenglund
Copy link
Member

pmenglund commented Aug 21, 2023

@dcu , do you mean something like this:

func (rc *RockClient) Query[Q any](ctx context.Context, sql string, options ...option.QueryOption) (openapi.QueryResponse, Q, error) {

where it tries to unmarshal QueryResponse.Result into the struct Q

@pmenglund pmenglund self-assigned this Aug 21, 2023
@dcu
Copy link
Author

dcu commented Aug 22, 2023

yes, exactly

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

No branches or pull requests

2 participants