mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
orm: allow both integer and string arguments in db.select and db.select limit 1
This commit is contained in:
parent
900df8ecf9
commit
cf06faf09b
4 changed files with 202 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue