orm: improve an fkey error a bit

This commit is contained in:
Alexander Medvednikov 2023-05-24 18:30:37 +02:00
parent e8dbd2c0c7
commit c45c36ccce
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ const (
) )
pub struct ClientState { pub struct ClientState {
mut: pub mut:
state State = .closed // current state of connection state State = .closed // current state of connection
} }

View file

@ -288,7 +288,7 @@ fn (mut g Gen) write_orm_insert_with_last_ids(node ast.SqlStmtLine, connection_v
} }
} }
if f_key == '' { if f_key == '' {
verror('An field which holds an array, needs a fkey defined') verror('a field which holds an array, needs a fkey defined ("${sym.name}")')
} }
fkeys << f_key fkeys << f_key
info := sym.array_info() info := sym.array_info()
@ -911,7 +911,7 @@ fn (mut g Gen) write_orm_select(node ast.SqlExpr, connection_var_name string, le
} }
// TODO: move to the ORM checker // TODO: move to the ORM checker
if fkey == '' { if fkey == '' {
verror('An field which holds an array, needs a `fkey` defined') verror('fn field which holds an array, needs a `fkey` defined ("${sym.name}")')
} }
info := sym.array_info() info := sym.array_info()
arr_typ := info.elem_type arr_typ := info.elem_type