MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / IDs

Method IDs

ent/mutation.go:8310–8323  ·  view source on GitHub ↗

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

(ctx context.Context)

Source from the content-addressed store, hash-verified

8308// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
8309// or updated by the mutation.
8310func (m *OAuthClientMutation) IDs(ctx context.Context) ([]int, error) {
8311 switch {
8312 case m.op.Is(OpUpdateOne | OpDeleteOne):
8313 id, exists := m.ID()
8314 if exists {
8315 return []int{id}, nil
8316 }
8317 fallthrough
8318 case m.op.Is(OpUpdate | OpDelete):
8319 return m.Client().OAuthClient.Query().Where(m.predicates...).IDs(ctx)
8320 default:
8321 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
8322 }
8323}
8324
8325// SetCreatedAt sets the "created_at" field.
8326func (m *OAuthClientMutation) SetCreatedAt(t time.Time) {

Callers

nothing calls this directly

Calls 5

IDMethod · 0.95
ClientMethod · 0.95
IDsMethod · 0.45
WhereMethod · 0.45
QueryMethod · 0.45

Tested by

no test coverage detected