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

Method SQL

pkg/sql/ast/sql.go:969–982  ·  view source on GitHub ↗

SQL returns the SQL representation of this VALUES clause as "VALUES (v1, v2), (v3, v4), ...".

()

Source from the content-addressed store, hash-verified

967// SQL returns the SQL representation of this VALUES clause as
968// "VALUES (v1, v2), (v3, v4), ...".
969func (v *Values) SQL() string {
970 if v == nil {
971 return ""
972 }
973 rows := make([]string, len(v.Rows))
974 for i, row := range v.Rows {
975 vals := make([]string, len(row))
976 for j, val := range row {
977 vals[j] = exprSQL(val)
978 }
979 rows[i] = "(" + strings.Join(vals, ", ") + ")"
980 }
981 return "VALUES " + strings.Join(rows, ", ")
982}
983
984// SQL returns the full SQL string for this CREATE VIEW statement including the
985// optional OR REPLACE, TEMPORARY, IF NOT EXISTS, column list, SELECT query,

Callers 2

TestValues_SQLFunction · 0.95
TestNilSQLFunction · 0.95

Calls 1

exprSQLFunction · 0.70

Tested by 2

TestValues_SQLFunction · 0.76
TestNilSQLFunction · 0.76