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

PartiQL #256

Merged
merged 18 commits into from
Oct 16, 2024
Merged

PartiQL #256

merged 18 commits into from
Oct 16, 2024

Conversation

ChrixApp
Copy link
Contributor

@ChrixApp ChrixApp commented Sep 9, 2024

PartiQL statements have to be passed as strings, and all parameters have to be passed as attribute values.

It provides a low-level implementation that returns a response containing Documents.

There is also a way to map the response directly into classes to skip the attribute allocations.

If anything needs to be added or modified, please give me feedback, and I'll make the necessary changes.

@firenero
Copy link
Contributor

Thanks for your contribution @ChrixApp! I will try to review and test it over the weekend.

@firenero firenero added the enhancement New feature or request label Sep 12, 2024
@firenero firenero self-assigned this Sep 12, 2024
Copy link
Contributor

@firenero firenero left a comment

Choose a reason for hiding this comment

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

I don't think that PartiQL API in its current form should be present in high-level API. While direct mapping to object can be important, the API itself looks out of place. Ideally, it should follow the same pattern as other methods. So something like this:

context.PartiQL().WithStatement("statement").WithParameters(parameters).ExecuteAsync();

Maybe it even worth having a statement builder similarly to UpdateExpression builder.

I understand that it's a big chunk of work so I'd suggest focusing on low-level API in this PR and leave the high-level API for future PRs.

The low-level implementation looks good overall but there are some comments about input/output types and overall consistency. After these are addressed we can merge the low-level API.

@ChrixApp
Copy link
Contributor Author

I've made the necessary changes based on your feedback, @firenero

Copy link
Contributor

@firenero firenero left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the feedback and sorry for the delay on my side. I was on vacation last week so next reviews will be much faster.

There are several more improvement points that I missed in the first review and it would be great to address them too.

Copy link
Contributor

@firenero firenero left a comment

Choose a reason for hiding this comment

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

Thanks for making changes. ExecuteStatement now works well. However, there are several issues in batch and transact responses parsing that I didn't notice in previous reviews.

@ChrixApp
Copy link
Contributor Author

Hi @firenero , are there any additional change needed?

Copy link
Contributor

@firenero firenero left a comment

Choose a reason for hiding this comment

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

It looks good now. There are only a couple small inefficiencies in response parsing. We can merge the PR after they are fixed.

Copy link
Contributor

@firenero firenero left a comment

Choose a reason for hiding this comment

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

It's perfect now! Huge thanks for submitting the PR and working with me on all these changes.

@firenero firenero merged commit 82bb835 into AllocZero:main Oct 16, 2024
1 check passed
@ChrixApp
Copy link
Contributor Author

Thanks, @firenero! It was a pleasure working with you as well. We still have the high-level PartiQL implementation pending and I was wondering when you plan to make the next release so I can plan my projects and use low-level PartiQL.

@firenero
Copy link
Contributor

@ChrixApp can you use pre-release version? If yes, PartiQL is available in 0.9.17-alpha.0.1. I was thinking about completing my work for #251 to bundle both features into single release. It might take a week or two because I have limited availability now. But let me know if you absolutely can't use pre-release version and I'll release stable with only PartiQL change early next week.

@ChrixApp
Copy link
Contributor Author

I can use the pre-release version 0.9.17-alpha.0.1, thanks @firenero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants