Skip to content

Commit

Permalink
docs: ko debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
shouwn committed Jan 25, 2024
1 parent 24d2718 commit 883f152
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/ko/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
* [Spring supports](jpql-with-kotlin-jdsl/spring-supports.md)
* [Migration 2.X to 3.X](jpql-with-kotlin-jdsl/migration-2.x-to-3.x.md)
* [Kotlin JDSL Roadmap](kotlin-jdsl-roadmap.md)

## FAQ

* [How can I see the generated query?](faq/how-can-i-see-the-generated-query.md)
26 changes: 26 additions & 0 deletions docs/ko/faq/how-can-i-see-the-generated-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 어떻게 생성된 쿼리를 볼 수 있나요?

Kotlin JDSL은 DSL를 통해 생성된 쿼리 및 파라미터를 debug 로그로 출력합니다. 그렇기 때문에 `com.linecorp.kotlinjdsl` 패키지의 로그 레벨을 debug로 수정하면 보실 수 있습니다.

로그에 포함된 파라미터의 경우 `toString` 함수로 출력되기 때문에 만약 `toString` 함수가 오버라이드 되지 않았다면 식별에 어려움이 있을 수 있습니다.

```
select(
path(Book::isbn),
).from(
entity(Book::class),
).where(
path(Book::publishDate).between(
OffsetDateTime.parse("2023-01-01T00:00:00+09:00"),
OffsetDateTime.parse("2023-06-30T23:59:59+09:00"),
),
).orderBy(
path(Book::isbn).asc(),
)
```

```
2023-01-01T00:00:00.000+09:00 DEBUG c.l.kotlinjdsl.render.jpql.JpqlRenderer : The query is rendered.
SELECT Book.isbn FROM Book AS Book WHERE Book.publishDate BETWEEN :param1 AND :param2 ORDER BY Book.isbn ASC
{param1=2023-01-01T00:00+09:00, param2=2023-06-30T23:59:59+09:00}
```

0 comments on commit 883f152

Please sign in to comment.