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

orm: handle missing rows

This commit is contained in:
Alexander Medvednikov
2020-06-26 20:38:17 +02:00
parent d2a4762c6a
commit d52f1da7a2
3 changed files with 25 additions and 16 deletions

View File

@ -162,6 +162,12 @@ fn test_orm_sqlite() {
}
assert kate3.age == 34
assert kate3.name == 'Kate N'
//
no_user := sql db {
select from User where id == 30
}
assert no_user.name == '' // TODO optional
assert no_user.age == 0
}
struct User {