In sa/database.go, we have InitWrappedDB, which does a variety of things, in particular:
- Sets up the borp type<->table mapping.
- Sets connection lifetimes and limits from a
cmd.DBConfig.
- Configures metrics.
- Calls
db.NewWrappedMap (annotates DB errors with extra info).
We should factor InitWrappedDB into its own package, for use with any database operations that might not want the same borp type<->table mapping as the SA, or that might not want to depend on the SA.
In sa/database.go, we have InitWrappedDB, which does a variety of things, in particular:
cmd.DBConfig.db.NewWrappedMap(annotates DB errors with extra info).We should factor InitWrappedDB into its own package, for use with any database operations that might not want the same borp type<->table mapping as the SA, or that might not want to depend on the SA.