MCPcopy Index your code
hub / github.com/apache/devlake / CallDB

Function CallDB

backend/helpers/pluginhelper/api/misc_helpers.go:27–33  ·  view source on GitHub ↗

CallDB wraps DB calls with this signature, and handles the case if the struct is wrapped in a models.DynamicTabler.

(f func(any, ...dal.Clause) errors.Error, x any, clauses ...dal.Clause)

Source from the content-addressed store, hash-verified

25
26// CallDB wraps DB calls with this signature, and handles the case if the struct is wrapped in a models.DynamicTabler.
27func CallDB(f func(any, ...dal.Clause) errors.Error, x any, clauses ...dal.Clause) errors.Error {
28 if dynamic, ok := x.(models.DynamicTabler); ok {
29 clauses = append(clauses, dal.From(dynamic.TableName()))
30 x = dynamic.Unwrap()
31 }
32 return f(x, clauses...)
33}

Callers 5

FirstByIdMethod · 0.85
FirstByNameMethod · 0.85
ListMethod · 0.85
deleteConnectionMethod · 0.85
saveMethod · 0.85

Calls 3

FromMethod · 0.65
TableNameMethod · 0.65
UnwrapMethod · 0.65

Tested by

no test coverage detected