Expand typed SQL DSL

This commit is contained in:
pavel 2026-08-28 00:02:32 +02:00
commit 314c8fb207
17 changed files with 1082 additions and 498 deletions

View file

@ -406,6 +406,11 @@ func (resolver *semanticResolver) resolveStmts(stmts []Stmt, scope *Scope, class
}
value.Value, _ = resolver.resolveExpr(value.Value, scope, class, UnknownType{})
stmts[index] = value
case FieldAssignStmt:
target, targetType := resolver.resolveExpr(value.Target, scope, class, UnknownType{})
value.Target = target.(SelectorExpr)
value.Value, _ = resolver.resolveExpr(value.Value, scope, class, targetType)
stmts[index] = value
case ReturnStmt:
if value.Value != nil {
value.Value, _ = resolver.resolveExpr(value.Value, scope, class, returnType)
@ -932,7 +937,8 @@ var semanticBuiltins = map[string]bool{
"append": true, "keys": true, "goAssert": true, "len": true, "cap": true,
"make": true, "new": true, "copy": true, "delete": true, "close": true,
"panic": true, "recover": true, "string": true, "int": true, "float64": true, "bool": true,
"sql": true, "set": true, "now": true, "Result": true, "ByteSlice": true,
"sql": true, "now": true, "Result": true, "ByteSlice": true,
"count": true, "countDistinct": true, "sum": true, "avg": true, "min": true, "max": true,
"runBlocking": true, "withContext": true, "coroutineScope": true, "launch": true, "async": true,
"delay": true, "withTimeout": true, "isActive": true, "coroutineContext": true,
"continue": true, "break": true,