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

Implement Dynamic Batch Actions #8

Merged
merged 1 commit into from
Jun 27, 2021
Merged

Conversation

deusaquilus
Copy link
Contributor

In Scala2-Quill, dynamic batch actions are not supported (i.e. doing them will cause an error - see here) however, because they do not require and inline def, porting them to Scala 3 will result in a dynamic-batch-action with the same code as before. This was discovered original in the Quill testing codebase in the following: form:

// Dynamic in Scala2-Quill, static in ProtoQuill
val insertPeople = quote((p: Person) => query[Person].insert(p))
val mirror = ctx.run { liftQuery(people).foreach(p => insertPeople(p)) }

I.e. since insertPeople is not an inline def, it becomes dynamic in ProtoQuill. That means that if we don't support dynamic queries this code will not be portable.

For this reason, I have decided to implement dynamic-batch-queries in ProtoQuill. This required an extensive refactoring of BatchExecutionQuery.scala.

@deusaquilus deusaquilus merged commit 795a60a into master Jun 27, 2021
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.

1 participant