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

Function TestClickHouseFinal

pkg/sql/parser/clickhouse_test.go:47–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestClickHouseFinal(t *testing.T) {
48 sql := `SELECT * FROM orders FINAL`
49 tree, err := parser.ParseWithDialect(sql, keywords.DialectClickHouse)
50 if err != nil {
51 t.Fatalf("unexpected error parsing FINAL modifier: %v", err)
52 }
53 sel, ok := tree.Statements[0].(*ast.SelectStatement)
54 if !ok {
55 t.Fatalf("expected SelectStatement, got %T", tree.Statements[0])
56 }
57 if len(sel.From) == 0 || !sel.From[0].Final {
58 t.Error("expected FINAL=true on first TableReference")
59 }
60}
61
62func TestClickHouseKeywordRecognition(t *testing.T) {
63 t.Skip("TODO: SAMPLE clause parsing not yet implemented")

Callers

nothing calls this directly

Calls 3

ParseWithDialectFunction · 0.92
FatalfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected