MCPcopy
hub / github.com/cloudreve/cloudreve / Query

Method Query

inventory/debug/debug.go:153–161  ·  view source on GitHub ↗

Query logs its params and calls the underlying transaction Query method.

(ctx context.Context, query string, args, v any)

Source from the content-addressed store, hash-verified

151
152// Query logs its params and calls the underlying transaction Query method.
153func (d *DebugTx) Query(ctx context.Context, query string, args, v any) error {
154 start := time.Now()
155 err := d.Tx.Query(ctx, query, args, v)
156 if skip, ok := ctx.Value(SkipDbLogging{}).(bool); ok && skip {
157 return err
158 }
159 d.log(ctx, fmt.Sprintf("Tx(%s).Query: query=%v args=%v time=%v", d.id, query, args, time.Since(start)))
160 return err
161}
162
163// QueryContext logs its params and calls the underlying transaction QueryContext method if it is supported.
164func (d *DebugTx) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) {

Callers 15

GetByIDMethod · 0.45
GetByNameIDMethod · 0.45
UpdateMethod · 0.45
CountByTimeRangeMethod · 0.45
indexableFilesQueryMethod · 0.45
CreateDirectLinkMethod · 0.45
GetByHashIDMethod · 0.45
RemoveEntitiesByIDMethod · 0.45
StaleEntitiesMethod · 0.45
DeleteByUserMethod · 0.45

Calls 2

SinceMethod · 0.65
ValueMethod · 0.45

Tested by

no test coverage detected