1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

orm: allow both integer and string arguments in db.select and db.select limit 1

This commit is contained in:
Delyan Angelov
2019-08-20 17:32:39 +03:00
committed by Alexander Medvednikov
parent 900df8ecf9
commit cf06faf09b
4 changed files with 202 additions and 16 deletions

View File

@ -84,7 +84,7 @@ mut:
is_vweb bool
is_sql bool
sql_i int // $1 $2 $3
sql_params string // ("select * from users where id = $1", ***"100"***)
sql_params []string // ("select * from users where id = $1", ***"100"***)
}
const (
@ -1400,7 +1400,7 @@ fn (p mut Parser) bterm() string {
p.gen('$' + p.sql_i.str())
p.cgen.start_cut()
p.check_types(p.expression(), typ)
p.sql_params = p.sql_params + p.cgen.cut() + ','
p.sql_params << p.cgen.cut()
//println('sql params = "$p.sql_params"')
} else {
p.check_types(p.expression(), typ)