getDialect extracts an optional dialect from the second JS argument. Returns empty string if not provided or unrecognized.
(args []js.Value)
| 47 | // getDialect extracts an optional dialect from the second JS argument. |
| 48 | // Returns empty string if not provided or unrecognized. |
| 49 | func 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 | |
| 59 | func parse(_ js.Value, args []js.Value) any { |
| 60 | if len(args) == 0 { |