fix sql_create_table that use int(bool)

pull/13844/head
yuyi98 2022-03-28 09:34:09 +08:00
parent 90d41b63b8
commit 33957f9158
1 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ fn (mut g Gen) sql_create_table(node ast.SqlStmtLine, expr string, table_name st
} }
g.write('.typ = $typ,') g.write('.typ = $typ,')
g.write('.is_arr = ${sym.kind == .array}, ') g.write('.is_arr = ${sym.kind == .array}, ')
g.write('.is_time = ${int(g.table.get_type_name(field.typ) == 'time__Time')},') g.write('.is_time = ${g.table.get_type_name(field.typ) == 'time__Time'},')
g.write('.default_val = (string){.str = (byteptr) "$field.default_val", .is_lit = 1},') g.write('.default_val = (string){.str = (byteptr) "$field.default_val", .is_lit = 1},')
g.write('.attrs = new_array_from_c_array($field.attrs.len, $field.attrs.len, sizeof(StructAttribute),') g.write('.attrs = new_array_from_c_array($field.attrs.len, $field.attrs.len, sizeof(StructAttribute),')
if field.attrs.len > 0 { if field.attrs.len > 0 {
@ -128,7 +128,7 @@ fn (mut g Gen) sql_create_table(node ast.SqlStmtLine, expr string, table_name st
for attr in field.attrs { for attr in field.attrs {
g.write('(StructAttribute){') g.write('(StructAttribute){')
g.write('.name = _SLIT("$attr.name"),') g.write('.name = _SLIT("$attr.name"),')
g.write('.has_arg = ${int(attr.has_arg)},') g.write('.has_arg = $attr.has_arg,')
g.write('.arg = _SLIT("$attr.arg"),') g.write('.arg = _SLIT("$attr.arg"),')
g.write('.kind = ${int(attr.kind)},') g.write('.kind = ${int(attr.kind)},')
g.write('},') g.write('},')