MCPcopy Create free account
hub / github.com/araddon/qlbridge / TestToSql

Function TestToSql

rel/sql_test.go:71–83  ·  view source on GitHub ↗

We need to be able to re-write queries, as we during joins we have to re-write query that we are going to send to a single data source

(t *testing.T)

Source from the content-addressed store, hash-verified

69// We need to be able to re-write queries, as we during joins we have
70// to re-write query that we are going to send to a single data source
71func TestToSql(t *testing.T) {
72 t.Parallel()
73 for _, sqlStrIn := range sqlStrings {
74 u.Debug("parsing next one ", sqlStrIn)
75 stmt1 := parseOrPanic(t, sqlStrIn)
76 sqlSel1 := stmt1.(*rel.SqlSelect)
77 sqlRt := sqlSel1.String()
78 u.Warnf("About to parse roundtrip \n%v", sqlRt)
79 stmt2 := parseOrPanic(t, sqlRt)
80 compareAst(t, stmt1, stmt2)
81 //comparePb(t, stmt1, stmt2)
82 }
83}
84
85/*
86func comparePb(t *testing.T, sl, sr SqlStatement) {

Callers

nothing calls this directly

Calls 3

parseOrPanicFunction · 0.85
compareAstFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected