databaseImport enforces not importing any database types into /codersdk. nolint:unused,deadcode,varnamelen
(m dsl.Matcher)
| 130 | // |
| 131 | //nolint:unused,deadcode,varnamelen |
| 132 | func databaseImport(m dsl.Matcher) { |
| 133 | m.Import("github.com/coder/coder/v2/coderd/database") |
| 134 | m.Match("database.$_"). |
| 135 | Report("Do not import any database types into codersdk"). |
| 136 | Where( |
| 137 | m.File().PkgPath.Matches("github.com/coder/coder/v2/codersdk") && |
| 138 | !m.File().Name.Matches(`_test\.go$`), |
| 139 | ) |
| 140 | } |
| 141 | |
| 142 | // publishInTransaction detects calls to Publish inside database transactions |
| 143 | // which can lead to connection starvation. |