MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / DBClient

Method DBClient

application/dependency/dependency.go:329–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

327}
328
329func (d *dependency) DBClient() *ent.Client {
330 if d.dbClient != nil {
331 return d.dbClient
332 }
333
334 if d.rawEntClient == nil {
335 client, err := inventory.NewRawEntClient(d.Logger(), d.ConfigProvider())
336 if err != nil {
337 d.panicError(err)
338 }
339
340 d.rawEntClient = client
341 }
342
343 proSuffix := ""
344 if d.isPro {
345 proSuffix = "-pro"
346 }
347
348 client, err := inventory.InitializeDBClient(d.Logger(), d.rawEntClient, d.KV(), d.requiredDbVersion+proSuffix)
349 if err != nil {
350 d.panicError(err)
351 }
352
353 d.dbClient = client
354 return d.dbClient
355}
356
357func (d *dependency) KV() cache.Driver {
358 if d.kv != nil {

Callers 12

FsEventClientMethod · 0.95
SettingClientMethod · 0.95
UserClientMethod · 0.95
GroupClientMethod · 0.95
NodeClientMethod · 0.95
OAuthClientClientMethod · 0.95
FileClientMethod · 0.95
ShareClientMethod · 0.95
TaskClientMethod · 0.95
DavAccountClientMethod · 0.95
DirectLinkClientMethod · 0.95
StoragePolicyClientMethod · 0.95

Calls 6

LoggerMethod · 0.95
ConfigProviderMethod · 0.95
panicErrorMethod · 0.95
KVMethod · 0.95
NewRawEntClientFunction · 0.92
InitializeDBClientFunction · 0.92

Tested by

no test coverage detected