MCPcopy Index your code
hub / github.com/coder/coder / databaseImport

Function databaseImport

scripts/rules.go:132–140  ·  view source on GitHub ↗

databaseImport enforces not importing any database types into /codersdk. nolint:unused,deadcode,varnamelen

(m dsl.Matcher)

Source from the content-addressed store, hash-verified

130//
131//nolint:unused,deadcode,varnamelen
132func 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.

Callers

nothing calls this directly

Calls 3

MatchMethod · 0.80
ReportMethod · 0.65
MatchesMethod · 0.45

Tested by

no test coverage detected