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

Function parseSQLStrict

pkg/sql/parser/parser_strictness_test.go:39–50  ·  view source on GitHub ↗
(t *testing.T, sql string)

Source from the content-addressed store, hash-verified

37}
38
39func parseSQLStrict(t *testing.T, sql string) error {
40 t.Helper()
41 tkz := tokenizer.GetTokenizer()
42 defer tokenizer.PutTokenizer(tkz)
43 tokens, err := tkz.Tokenize([]byte(sql))
44 if err != nil {
45 t.Fatalf("tokenize error for %q: %v", sql, err)
46 }
47 p := NewParser(WithStrictMode())
48 _, err = p.ParseFromModelTokens(tokens)
49 return err
50}
51
52// =============================================================================
53// Issue #296 - Parser rejects malformed SQL with descriptive errors

Calls 8

ParseFromModelTokensMethod · 0.95
GetTokenizerFunction · 0.92
PutTokenizerFunction · 0.92
WithStrictModeFunction · 0.85
TokenizeMethod · 0.80
NewParserFunction · 0.70
HelperMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected