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

Function getDialect

wasm/main.go:49–57  ·  view source on GitHub ↗

getDialect extracts an optional dialect from the second JS argument. Returns empty string if not provided or unrecognized.

(args []js.Value)

Source from the content-addressed store, hash-verified

47// getDialect extracts an optional dialect from the second JS argument.
48// Returns empty string if not provided or unrecognized.
49func getDialect(args []js.Value) sqlkeywords.SQLDialect {
50 if len(args) > 1 && args[1].Type() == js.TypeString {
51 d := args[1].String()
52 if mapped, ok := dialectMap[d]; ok {
53 return mapped
54 }
55 }
56 return ""
57}
58
59func parse(_ js.Value, args []js.Value) any {
60 if len(args) == 0 {

Callers 5

parseFunction · 0.85
formatFunction · 0.85
lintFunction · 0.85
validateFunction · 0.85
analyzeFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected