MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / validate

Function validate

wasm/main.go:122–135  ·  view source on GitHub ↗
(_ js.Value, args []js.Value)

Source from the content-addressed store, hash-verified

120}
121
122func validate(_ js.Value, args []js.Value) any {
123 if len(args) == 0 {
124 return jsonError("no SQL provided")
125 }
126 sql := args[0].String()
127 // dialect is accepted for API consistency
128 _ = getDialect(args)
129
130 err := gosqlx.Validate(sql)
131 if err != nil {
132 return jsonResult(map[string]any{"valid": false, "error": err.Error()})
133 }
134 return jsonResult(map[string]any{"valid": true})
135}
136
137func analyze(_ js.Value, args []js.Value) any {
138 if len(args) == 0 {

Callers

nothing calls this directly

Calls 6

ValidateFunction · 0.92
jsonErrorFunction · 0.85
getDialectFunction · 0.85
jsonResultFunction · 0.85
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected