MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / convertQuery

Function convertQuery

internal/engine/postgresql/convert.go:2139–2180  ·  view source on GitHub ↗
(n *pg.Query)

Source from the content-addressed store, hash-verified

2137}
2138
2139func convertQuery(n *pg.Query) *ast.Query {
2140 if n == nil {
2141 return nil
2142 }
2143 return &ast.Query{
2144 CommandType: ast.CmdType(n.CommandType),
2145 QuerySource: ast.QuerySource(n.QuerySource),
2146 CanSetTag: n.CanSetTag,
2147 UtilityStmt: convertNode(n.UtilityStmt),
2148 ResultRelation: int(n.ResultRelation),
2149 HasAggs: n.HasAggs,
2150 HasWindowFuncs: n.HasWindowFuncs,
2151 HasTargetSrfs: n.HasTargetSrfs,
2152 HasSubLinks: n.HasSubLinks,
2153 HasDistinctOn: n.HasDistinctOn,
2154 HasRecursive: n.HasRecursive,
2155 HasModifyingCte: n.HasModifyingCte,
2156 HasForUpdate: n.HasForUpdate,
2157 HasRowSecurity: n.HasRowSecurity,
2158 CteList: convertSlice(n.CteList),
2159 Rtable: convertSlice(n.Rtable),
2160 Jointree: convertFromExpr(n.Jointree),
2161 TargetList: convertSlice(n.TargetList),
2162 Override: ast.OverridingKind(n.Override),
2163 OnConflict: convertOnConflictExpr(n.OnConflict),
2164 ReturningList: convertSlice(n.ReturningList),
2165 GroupClause: convertSlice(n.GroupClause),
2166 GroupingSets: convertSlice(n.GroupingSets),
2167 HavingQual: convertNode(n.HavingQual),
2168 WindowClause: convertSlice(n.WindowClause),
2169 DistinctClause: convertSlice(n.DistinctClause),
2170 SortClause: convertSlice(n.SortClause),
2171 LimitOffset: convertNode(n.LimitOffset),
2172 LimitCount: convertNode(n.LimitCount),
2173 RowMarks: convertSlice(n.RowMarks),
2174 SetOperations: convertNode(n.SetOperations),
2175 ConstraintDeps: convertSlice(n.ConstraintDeps),
2176 WithCheckOptions: convertSlice(n.WithCheckOptions),
2177 StmtLocation: int(n.StmtLocation),
2178 StmtLen: int(n.StmtLen),
2179 }
2180}
2181
2182func convertRangeFunction(n *pg.RangeFunction) *ast.RangeFunction {
2183 if n == nil {

Callers 2

convertRangeTblEntryFunction · 0.85
convertNodeFunction · 0.85

Calls 7

CmdTypeTypeAlias · 0.92
QuerySourceTypeAlias · 0.92
OverridingKindTypeAlias · 0.92
convertNodeFunction · 0.85
convertSliceFunction · 0.85
convertFromExprFunction · 0.85
convertOnConflictExprFunction · 0.85

Tested by

no test coverage detected