(app App, selectQuery string)
| 520 | } |
| 521 | |
| 522 | func getQueryTableInfo(app App, selectQuery string) ([]*TableInfoRow, error) { |
| 523 | tempView := "_temp_" + security.PseudorandomString(6) |
| 524 | |
| 525 | var info []*TableInfoRow |
| 526 | |
| 527 | txErr := app.RunInTransaction(func(txApp App) error { |
| 528 | // create a temp view with the provided query |
| 529 | err := txApp.SaveView(tempView, selectQuery) |
| 530 | if err != nil { |
| 531 | return err |
| 532 | } |
| 533 | |
| 534 | // extract the generated view table info |
| 535 | info, err = txApp.TableInfo(tempView) |
| 536 | |
| 537 | return errors.Join(err, txApp.DeleteView(tempView)) |
| 538 | }) |
| 539 | |
| 540 | if txErr != nil { |
| 541 | return nil, txErr |
| 542 | } |
| 543 | |
| 544 | return info, nil |
| 545 | } |
| 546 | |
| 547 | // ------------------------------------------------------------------- |
| 548 | // Raw query identifiers parser |
no test coverage detected
searching dependent graphs…