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

Log SQL with values for batch insert #1944

Merged
merged 1 commit into from Jan 28, 2019
Merged

Log SQL with values for batch insert #1944

merged 1 commit into from Jan 28, 2019

Conversation

chipz
Copy link
Contributor

@chipz chipz commented Aug 17, 2018

Using the new logger statementAndParameters we can log the values for batch insert

see @d6y comments and #1942

Adding the logger:

<logger name="slick.jdbc.JdbcBackend.statementAndParameter" level="DEBUG" />

will log executable SQL statements with real value instead of ?

cc: @trevorsibanda

Thank you

with logger `statementAndParameters`
@d6y
Copy link
Contributor

d6y commented Aug 22, 2018

Thank you @chipz - this works for me!

I used a ++= with a Seq[T] of length 4 and saw what I expected:

DEBUG s.j.J.statementAndParameter - Executing batch insert: prep2: insert into "message" ("sender","content")  values (?,?) {1: 'HAL', 2: 'Affirmative, Dave. I read you.'}

DEBUG s.j.J.statementAndParameter - Executing batch insert: prep2: insert into "message" ("sender","content")  values (?,?) {1: 'Dave', 2: 'Open the pod bay doors, HAL.'}

DEBUG s.j.J.statementAndParameter - Executing batch insert: prep2: insert into "message" ("sender","content")  values (?,?) {1: 'HAL', 2: 'I''m sorry, Dave. I''m afraid I can''t do that.'}

DEBUG s.j.J.statementAndParameter - Executing batch insert: prep2: insert into "message" ("sender","content")  values (?,?) {1: 'Dave', 2: NULL}

@hvesalai hvesalai added this to the 3.3 milestone Oct 8, 2018
@octonato octonato merged commit f7f0931 into slick:master Jan 28, 2019
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

5 participants