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

orm: allow variables like q.nr_orders in queries too.

This commit is contained in:
Delyan Angelov
2019-08-20 18:05:56 +03:00
committed by Alexander Medvednikov
parent caa6eacf39
commit 1ddc9dc604
3 changed files with 25 additions and 8 deletions

View File

@ -38,7 +38,7 @@ fn main() {
println('------------------------------------------------------------------------')
q := Customer{}
for {
anon := db.select from Customer where id = 12345 && nr_orders > q.nr_orders limit 1 or { eprintln('No such customer. Error: $err') break }
anon := db.select from Customer where id = 12345 && name = q.name && nr_orders > q.nr_orders limit 1 or { eprintln('No such customer. Error: $err') break }
println('Non existing customer name: $anon.name')
break
}
@ -52,4 +52,5 @@ fn main() {
db.insert(nc)
*/
}