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

orm: fix other int types (#11981)

This commit is contained in:
Louis Schmieder
2021-09-26 10:17:56 +02:00
committed by GitHub
parent e09860731f
commit 6391f3d2da
3 changed files with 21 additions and 3 deletions

View File

@ -8,6 +8,7 @@ struct Module {
id int [primary; sql: serial]
name string
nr_downloads int
test_id u64
user User
}
@ -33,7 +34,7 @@ fn test_orm_sqlite() {
db := sqlite.connect(':memory:') or { panic(err) }
db.exec('drop table if exists User')
sql db {
create table User
create table Module
}
name := 'Peter'
@ -313,4 +314,20 @@ fn test_orm_sqlite() {
}
assert data.len == 1
mod := Module{}
sql db {
insert mod into Module
}
sql db {
update Module set test_id = 11 where id == 1
}
test_id_mod := sql db {
select from Module where id == 1
}
assert test_id_mod.test_id == 11
}