New creates a new DbRecorder. (The squirrel.DBProxy interface defines the functions normal for a database connection or a prepared statement cache.)
(db squirrel.DBProxyBeginner, flavor string)
| 261 | // (The squirrel.DBProxy interface defines the functions normal for a database connection |
| 262 | // or a prepared statement cache.) |
| 263 | func New(db squirrel.DBProxyBeginner, flavor string) *DbRecorder { |
| 264 | b := squirrel.StatementBuilder.RunWith(db) |
| 265 | r := new(DbRecorder) |
| 266 | r.builder = &b |
| 267 | r.db = db |
| 268 | r.flavor = flavor |
| 269 | |
| 270 | if flavor == "postgres" { |
| 271 | b = b.PlaceholderFormat(squirrel.Dollar) |
| 272 | } |
| 273 | |
| 274 | return r |
| 275 | } |
| 276 | |
| 277 | // Bind binds a DbRecorder to a Record. |
| 278 | // |
no outgoing calls