(q)
| 183 | } |
| 184 | |
| 185 | function toBuffer(q) { |
| 186 | if (q.parameters.length >= 65534) |
| 187 | throw Errors.generic('MAX_PARAMETERS_EXCEEDED', 'Max number of parameters (65534) exceeded') |
| 188 | |
| 189 | return q.options.simple |
| 190 | ? b().Q().str(q.statement.string + b.N).end() |
| 191 | : q.describeFirst |
| 192 | ? Buffer.concat([describe(q), Flush]) |
| 193 | : q.prepare |
| 194 | ? q.prepared |
| 195 | ? prepared(q) |
| 196 | : Buffer.concat([describe(q), prepared(q)]) |
| 197 | : unnamed(q) |
| 198 | } |
| 199 | |
| 200 | function describe(q) { |
| 201 | return Buffer.concat([ |