(ctx *tree.FmtCtx)
| 1264 | } |
| 1265 | |
| 1266 | func (s *Fetch) Format(ctx *tree.FmtCtx) { |
| 1267 | ctx.WithAnnotations(s.Annotations, func() { |
| 1268 | if s.IsMove { |
| 1269 | ctx.WriteString("MOVE ") |
| 1270 | } else { |
| 1271 | ctx.WriteString("FETCH ") |
| 1272 | } |
| 1273 | if dir := s.Cursor.FetchType.String(); dir != "" { |
| 1274 | ctx.WriteString(dir) |
| 1275 | ctx.WriteString(" ") |
| 1276 | } |
| 1277 | if s.Cursor.FetchType.HasCount() { |
| 1278 | ctx.WriteString(strconv.Itoa(int(s.Cursor.Count))) |
| 1279 | ctx.WriteString(" ") |
| 1280 | } |
| 1281 | ctx.WriteString("FROM ") |
| 1282 | ctx.FormatName(string(s.Cursor.Name)) |
| 1283 | if s.Target != nil { |
| 1284 | ctx.WriteString(" INTO ") |
| 1285 | for i := range s.Target { |
| 1286 | if i > 0 { |
| 1287 | ctx.WriteString(", ") |
| 1288 | } |
| 1289 | ctx.FormatNode(&s.Target[i]) |
| 1290 | } |
| 1291 | } |
| 1292 | ctx.WriteString(";\n") |
| 1293 | }) |
| 1294 | } |
| 1295 | |
| 1296 | func (s *Fetch) PlpgSQLStatementTag() string { |
| 1297 | if s.IsMove { |
nothing calls this directly
no test coverage detected