MCPcopy Create free account
hub / github.com/crowdsecurity/crowdsec / ID

Method ID

pkg/database/ent/machine_create.go:1072–1078  ·  view source on GitHub ↗

Exec executes the UPSERT query and returns the inserted/updated ID.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1070
1071// Exec executes the UPSERT query and returns the inserted/updated ID.
1072func (u *MachineUpsertOne) ID(ctx context.Context) (id int, err error) {
1073 node, err := u.create.Save(ctx)
1074 if err != nil {
1075 return id, err
1076 }
1077 return node.ID, nil
1078}
1079
1080// IDX is like ID, but panics if an error occurs.
1081func (u *MachineUpsertOne) IDX(ctx context.Context) int {

Callers 1

IDXMethod · 0.95

Calls 1

SaveMethod · 0.45

Tested by

no test coverage detected