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

Struct SqlSource

rel/sql.go:115–136  ·  view source on GitHub ↗

SqlSource is a table name, sub-query, or join as used in SELECT FROM - SELECT .. FROM table_name - SELECT .. from (select a,b,c from tableb) - SELECT .. FROM tablex INNER JOIN ...

Source from the content-addressed store, hash-verified

113 // - SELECT .. from (select a,b,c from tableb)
114 // - SELECT .. FROM tablex INNER JOIN ...
115 SqlSource struct {
116 final bool // has this been finalized?
117 alias string // either the short table name or full
118 cols map[string]*Column // Un-aliased columns, ie "x.y" -> "y"
119 colIndex map[string]int // Key(alias) to index in []driver.Value positions
120 joinNodes []expr.Node // x.y = q.y AND x.z = q.z --- []Node{Identity{x},Identity{z}}
121 Source *SqlSelect // Sql Select Source query, written by Rewrite
122 Raw string // Raw Partial Query
123 Name string // From Name (optional, empty if join, subselect)
124 Alias string // From name aliased
125 Schema string // FROM `schema`.`table`
126 Op lex.TokenType // In, =, ON
127 LeftOrRight lex.TokenType // Left, Right
128 JoinType lex.TokenType // INNER, OUTER
129 JoinExpr expr.Node // Join expression x.y = q.y
130 SubQuery *SqlSelect // optional, Join/SubSelect statement
131
132 // Plan Hints, move to a dedicated planner
133 Seekable bool
134 // Memoized sql, we assume this is an immuteable struct so if this is populated use it
135 pb *SqlSourcePb
136 }
137 // SqlWhere WHERE is select stmt, or set of expressions
138 // - WHERE x in (select name from q)
139 // - WHERE x = y

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected