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