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

ci,cgen,orm: fix CI failures after 9f118ba

This commit is contained in:
Delyan Angelov 2023-05-02 21:27:53 +03:00
parent 9f118ba3f1
commit 5631e2f01d
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,7 @@ fn test_use_struct_field_as_limit() {
sam := User{
age: 29
name: 'Sam'
skipped_string2: 'this should be ignored'
}
sql db {
@ -60,6 +61,8 @@ fn test_use_struct_field_as_limit() {
}!
assert users.len == 1
assert users[0].name == 'Sam'
assert users[0].age == 29
assert users[0].skipped_string == ''
assert users[0].skipped_string2 == ''
}

View File

@ -404,6 +404,9 @@ fn (mut g Gen) write_orm_insert_with_last_ids(node ast.SqlStmtLine, connection_v
if attr.name == 'skip' {
skip = true
}
if attr.name == 'sql' && attr.arg == '-' {
skip = true
}
}
if !skip && !primary {
fff << f
@ -693,6 +696,9 @@ fn (mut g Gen) write_orm_select(node ast.SqlExpr, connection_var_name string, le
if attr.name == 'skip' {
skip = true
}
if attr.name == 'sql' && attr.arg == '-' {
skip = true
}
}
if !skip {
fields << field
@ -996,6 +1002,9 @@ fn (_ &Gen) filter_struct_fields_by_orm_attrs(fields []ast.StructField) []ast.St
if attr.name == 'skip' {
skip = true
}
if attr.name == 'sql' && attr.arg == '-' {
skip = true
}
}
if !skip && !primary {