| 33 | } |
| 34 | |
| 35 | requiresPreparation() { |
| 36 | if (this.queryMode === 'extended') { |
| 37 | return true |
| 38 | } |
| 39 | |
| 40 | // named queries must always be prepared |
| 41 | if (this.name) { |
| 42 | return true |
| 43 | } |
| 44 | // always prepare if there are max number of rows expected per |
| 45 | // portal execution |
| 46 | if (this.rows) { |
| 47 | return true |
| 48 | } |
| 49 | // don't prepare empty text queries |
| 50 | if (!this.text) { |
| 51 | return false |
| 52 | } |
| 53 | // prepare if there are values |
| 54 | if (!this.values) { |
| 55 | return false |
| 56 | } |
| 57 | return this.values.length > 0 |
| 58 | } |
| 59 | |
| 60 | _checkForMultirow() { |
| 61 | // if we already have a result with a command property |