Using SQL Interpolation with ScalikeJDBC

I’m attempting to follow the example for SQL interpolation in the ScalikeJDBC library. Here’s the code snippet I’m working with:

val userRecord = sql"select id, name from users where id = ${userId}"
println(userRecord.statement)

However, the output I receive is unexpected:

select id, name from users where id = ?

What could be the issue here?

EDIT and SOLUTION:

Upon further inspection, I realized the confusion arose from printing the SQL query without verifying its correctness. I needed to use SQLSyntax.createUnsafely with the string designated for interpolation.

Oh, that’s intriguing! Have you tried other methods within the library to see how they handle query outputs? I’m curious how different techniques might affect scalability or performance. Also, what do you think are the main benefits of using SQL interpolation in ScalikeJDBC over other libraries? :upside_down_face: