fix: pass the connector id when workflow database nod… (#599)
This commit is contained in:
@@ -423,6 +423,14 @@ func getExecUserID(ctx context.Context) int64 {
|
||||
return execCtx.RootCtx.ExeCfg.Operator
|
||||
}
|
||||
|
||||
func getConnectorID(ctx context.Context) int64 {
|
||||
execCtx := execute.GetExeCtx(ctx)
|
||||
if execCtx == nil {
|
||||
panic(fmt.Errorf("unable to get exe context"))
|
||||
}
|
||||
return execCtx.RootCtx.ExeCfg.ConnectorID
|
||||
}
|
||||
|
||||
func parseToInput(input map[string]any) map[string]any {
|
||||
result := make(map[string]any, len(input))
|
||||
for key, value := range input {
|
||||
|
||||
@@ -104,6 +104,7 @@ func (c *CustomSQL) Invoke(ctx context.Context, input map[string]any) (map[strin
|
||||
DatabaseInfoID: c.databaseInfoID,
|
||||
IsDebugRun: isDebugExecute(ctx),
|
||||
UserID: getExecUserID(ctx),
|
||||
ConnectorID: getConnectorID(ctx),
|
||||
}
|
||||
|
||||
inputBytes, err := sonic.Marshal(input)
|
||||
|
||||
@@ -108,6 +108,7 @@ func (d *Delete) Invoke(ctx context.Context, in map[string]any) (map[string]any,
|
||||
ConditionGroup: conditionGroup,
|
||||
IsDebugRun: isDebugExecute(ctx),
|
||||
UserID: getExecUserID(ctx),
|
||||
ConnectorID: getConnectorID(ctx),
|
||||
}
|
||||
|
||||
response, err := d.deleter.Delete(ctx, request)
|
||||
|
||||
@@ -90,6 +90,7 @@ func (is *Insert) Invoke(ctx context.Context, input map[string]any) (map[string]
|
||||
Fields: fields,
|
||||
IsDebugRun: isDebugExecute(ctx),
|
||||
UserID: getExecUserID(ctx),
|
||||
ConnectorID: getConnectorID(ctx),
|
||||
}
|
||||
|
||||
response, err := is.inserter.Insert(ctx, req)
|
||||
|
||||
@@ -141,6 +141,7 @@ func (ds *Query) Invoke(ctx context.Context, in map[string]any) (map[string]any,
|
||||
Limit: ds.limit,
|
||||
IsDebugRun: isDebugExecute(ctx),
|
||||
UserID: getExecUserID(ctx),
|
||||
ConnectorID: getConnectorID(ctx),
|
||||
}
|
||||
|
||||
req.ConditionGroup = conditionGroup
|
||||
|
||||
@@ -123,6 +123,7 @@ func (u *Update) Invoke(ctx context.Context, in map[string]any) (map[string]any,
|
||||
Fields: fields,
|
||||
IsDebugRun: isDebugExecute(ctx),
|
||||
UserID: getExecUserID(ctx),
|
||||
ConnectorID: getConnectorID(ctx),
|
||||
}
|
||||
|
||||
response, err := u.updater.Update(ctx, req)
|
||||
|
||||
Reference in New Issue
Block a user