How can I get raw query from builded one? #1173
-
Hi there! The question is, How can I get raw query from builded one? For example, I have next query - users, err := models.Users(
Select("id", "name"),
InnerJoin("credit_cards c on c.user_id = users.id"),
Where("age > ?", 30),
AndIn("c.kind in ?", "visa", "mastercard"),
Or("email like ?", `%aol.com%`),
GroupBy("id", "name"),
Having("count(c.id) > ?", 2),
Limit(5),
Offset(6),
).All(ctx, db) And I want to see final query that will be executed, how can I do it? |
Beta Was this translation helpful? Give feedback.
Answered by
stephenafamo
Aug 1, 2022
Replies: 1 comment 1 reply
-
If you set boil.DebugMode = true
users, err := models.Users(
// ....
).All(ctx, db)
boil.DebugMode = false |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
qerdcv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you set
boil.DebugMode = true
it will log the query and args