orm: fix `LIMIT var` as well

pull/5627/head
Delyan Angelov 2020-07-02 23:29:29 +03:00
parent 421b6d4a80
commit 7004f74b71
1 changed files with 1 additions and 0 deletions

View File

@ -145,6 +145,7 @@ fn (mut g Gen) sql_select_expr(node ast.SqlExpr) {
} }
if node.has_limit { if node.has_limit {
g.write(' LIMIT ') g.write(' LIMIT ')
g.sql_side = .right
g.expr_to_sql(node.limit_expr) g.expr_to_sql(node.limit_expr)
} }
if node.has_offset { if node.has_offset {