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

Implementing multi-row insert for liftQuery(...).foreach #172

Merged
merged 1 commit into from Aug 5, 2022

Conversation

deusaquilus
Copy link
Contributor

@deusaquilus deusaquilus commented Aug 5, 2022

Also Fixing: zio/zio-quill#1269 for ProtoQuill

Implementing multi-insertion capabilities for most contexts via the VALUES (clauseA), (clauseB), (clauseC), etc... construct. The performance benefits of this when working of a network with any kind of real latency are significant e.g. insertion of 1 million rows goes down from 6.6 minutes to 10 seconds!

@deusaquilus deusaquilus merged commit ccda0b7 into master Aug 5, 2022
@deusaquilus deusaquilus deleted the values-token-clause branch August 5, 2022 15:50
@@ -78,7 +78,7 @@ trait JdbcContextVerbExecute[+Dialect <: SqlIdiom, +Naming <: NamingStrategy] ex
groups.flatMap {
case BatchGroup(sql, prepare) =>
val ps = conn.prepareStatement(sql)
logger.underlying.debug("Batch: {}", sql)
//logger.underlying.debug("Batch: {}", sql.take(200) + (if (sql.length > 200) "..." else ""))

Choose a reason for hiding this comment

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

unintentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops. I’ll fix that

@@ -0,0 +1,7 @@
#!/bin/bash

# Make the Postgres DB image have 100ms latency for all requests.

Choose a reason for hiding this comment

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

50ms

@jilen
Copy link

jilen commented Aug 8, 2022

Are all variables sanitized ? I cannot find anything related.

For jdbc, it is safe to execute via addBatch. Not sure about other contexts.

@deusaquilus
Copy link
Contributor Author

deusaquilus commented Aug 8, 2022

@jilen

Are all variables sanitized ? I cannot find anything related.

Have a look at Particularize. It's like an advanced version of ReifyLiftings.

For jdbc, it is safe to execute via addBatch. Not sure about other contexts.

I'm only supporting this functionality for JDBC contexts for now. This will need to be tested separately for Jasync and others.

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.

None yet

3 participants