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

add more powerful versions of execute, select and selectFirst #20

Merged

Conversation

myazinn
Copy link
Collaborator

@myazinn myazinn commented Sep 25, 2022

Apparently, providing an environment sometimes can cause performance degradations and does not comply ZIO idiomatic application structure.
This MR adds new more powerful methods to Session which allow running interpolated queries directly. Note that cqlt methods are unsupported for now.

@myazinn myazinn force-pushed the add_more_powerful_versions_of_execute_select_selectFirst branch from 1fdd442 to a360f7d Compare September 25, 2022 13:39
@myazinn myazinn requested a review from narma September 25, 2022 13:39
@myazinn myazinn force-pushed the add_more_powerful_versions_of_execute_select_selectFirst branch from a360f7d to ee0d19a Compare September 25, 2022 13:45
final def prepare[V <: HList, R](query: ParameterizedQuery[V, R]): Task[Query[R]] =
prepare(query.template).map(_.applyProduct(query.values))

final def execute[V <: HList, R](query: ParameterizedQuery[V, R]): Task[Boolean] =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Inconsistent return type with def execute(stmt: Statement[_]): Task[AsyncResultSet] method, but consistent with Query#execute one

narma
narma previously approved these changes Sep 25, 2022
@myazinn myazinn force-pushed the add_more_powerful_versions_of_execute_select_selectFirst branch from ee0d19a to d469c08 Compare September 26, 2022 08:37
@myazinn myazinn changed the title draft: add more powerful versions of execute, select and selectFirst add more powerful versions of execute, select and selectFirst Sep 26, 2022
@myazinn myazinn force-pushed the add_more_powerful_versions_of_execute_select_selectFirst branch from d469c08 to 4f26785 Compare September 26, 2022 08:46
@myazinn myazinn force-pushed the add_more_powerful_versions_of_execute_select_selectFirst branch from 4f26785 to df86187 Compare September 26, 2022 08:46
@myazinn myazinn merged commit 4710b54 into master Sep 26, 2022
@narma narma deleted the add_more_powerful_versions_of_execute_select_selectFirst branch October 1, 2022 13:34
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.

2 participants