Skip to content

Commit ff44441

Browse files
authored
Update sql-interpolation.html.md.erb (#199)
1 parent 3ee82bc commit ff44441

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/documentation/sql-interpolation.html.md.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Here's an explanation of the differences between `m.id`, `m.result.id`, and `m.r
215215

216216
Additionally, using `Member.as(m)` translates to `members m` in SQL, contextualizing the Member table alias.
217217

218-
If you use `Member.syntax()`, the table name is included in aliases. For example, `m.result.groupId` becomes `"members.group_id as gi_on_members"`. If you set it as `Member.syntax("m")`, `m.result.groupId` translates to `"members.group_id as gi_on_m"`.
218+
If you use `Member.syntax()`, the table name is included in aliases. For example, `m.result.groupId` becomes `"members.group_id as gi_on_members"`. If you set it as `Member.syntax("m")`, `m.result.groupId` translates to `"m.group_id as gi_on_m"`.
219219

220220
That covers all the rules of `SQLSyntaxSupport`. I believe this explanation will make the following code easier for you to understand.
221221

@@ -238,7 +238,7 @@ You can use the above code this way:
238238

239239
```scala
240240
val m = Member.syntax("m")
241-
val members = sql"select ${m.result.*} from ${Member.as(m)}".map(Member(m)).list.apply()
241+
val members = sql"select ${m.result.*} from ${Member.as(m)}".map(Member(m.resultName)).list.apply()
242242
// select m.id as i_on_m, m.name as n_on_m from members m
243243
```
244244

0 commit comments

Comments
 (0)