(command string, args ...any)
| 169 | } |
| 170 | |
| 171 | func (c *Conn) Execute(command string, args ...any) (*Result, error) { |
| 172 | if len(args) == 0 { |
| 173 | return c.exec(command) |
| 174 | } else { |
| 175 | if s, err := c.Prepare(command); err != nil { |
| 176 | return nil, errors.Trace(err) |
| 177 | } else { |
| 178 | var r *Result |
| 179 | r, err = s.Execute(args...) |
| 180 | s.Close() |
| 181 | return r, err |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | // ExecuteSelectStreaming will call perRowCallback for every row in resultset |
| 187 | // |