Skip to content

Commit a8823d2

Browse files
authored
Merge pull request #36 from ShapelessCat/fix-comment-about-sql-string-interpolator
Fix the comment about the sql string interpolator
2 parents c5a9e8d + 07f1579 commit a8823d2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/scala/progscala3/contexts/SQLStringInterpolator.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ object SimpleSQL:
2626
def tup2Seq(t: (String,String)): Seq[String] = Seq(t._1, t._2) // <3>
2727
def keep(s: String): Boolean = s.length > 0 && s != "SELECT" && s != "FROM"
2828

29-
// It turns out that the length of the "values" passed to +sql+ will always
30-
// be one more than the length of the "sc.parts". If we use no variables,
31-
// "values" has one element, the whole string, and "sc.parts" is empty.
32-
// If we use a variable for the columns, then "values" will be
33-
// "Seq("SELECT ", "FROM")" and "sc.parts" will contain a string for columns.
34-
// Using a variable for the table name instead will be similar, but "values"
29+
// It turns out that the length of the "sc.parts" passed to +sql+ will always
30+
// be one more than the length of the "values". If we use no variables,
31+
// "sc.parts" has one element, the whole string, and "values" is empty.
32+
// If we use a variable for the columns, then "sc.parts" will be
33+
// "Seq("SELECT ", "FROM tableName")" and "values" will contain a string for columns.
34+
// Using a variable for the table name instead will be similar, but "sc.parts"
3535
// will end with an empty string. You can add print statements to see this
3636
// in action.
3737
// This is why these two sequences are combined with "zipAll", so we can

0 commit comments

Comments
 (0)