refactor(workflow): Move the database component in the Workflow package into the common crossdomain package (#704)

This commit is contained in:
Ryo
2025-08-12 15:42:58 +08:00
committed by GitHub
parent e7011f2549
commit 9ff065cebd
29 changed files with 834 additions and 1353 deletions

View File

@@ -204,3 +204,110 @@ type GetAllDatabaseByAppIDRequest struct {
type GetAllDatabaseByAppIDResponse struct {
Databases []*Database // online databases
}
type SQLParam struct {
Value string
IsNull bool
}
type CustomSQLRequest struct {
DatabaseInfoID int64
SQL string
Params []SQLParam
IsDebugRun bool
UserID string
ConnectorID int64
}
type Object = map[string]any
type Response struct {
RowNumber *int64
Objects []Object
}
type Operator string
type ClauseRelation string
const (
ClauseRelationAND ClauseRelation = "and"
ClauseRelationOR ClauseRelation = "or"
)
const (
OperatorEqual Operator = "="
OperatorNotEqual Operator = "!="
OperatorGreater Operator = ">"
OperatorLesser Operator = "<"
OperatorGreaterOrEqual Operator = ">="
OperatorLesserOrEqual Operator = "<="
OperatorIn Operator = "in"
OperatorNotIn Operator = "not_in"
OperatorIsNull Operator = "is_null"
OperatorIsNotNull Operator = "is_not_null"
OperatorLike Operator = "like"
OperatorNotLike Operator = "not_like"
)
type ClauseGroup struct {
Single *Clause
Multi *MultiClause
}
type Clause struct {
Left string
Operator Operator
}
type MultiClause struct {
Clauses []*Clause
Relation ClauseRelation
}
type ConditionStr struct {
Left string
Operator Operator
Right any
}
type ConditionGroup struct {
Conditions []*ConditionStr
Relation ClauseRelation
}
type DeleteRequest struct {
DatabaseInfoID int64
ConditionGroup *ConditionGroup
IsDebugRun bool
UserID string
ConnectorID int64
}
type QueryRequest struct {
DatabaseInfoID int64
SelectFields []string
Limit int64
ConditionGroup *ConditionGroup
OrderClauses []*OrderClause
IsDebugRun bool
UserID string
ConnectorID int64
}
type OrderClause struct {
FieldID string
IsAsc bool
}
type UpdateRequest struct {
DatabaseInfoID int64
ConditionGroup *ConditionGroup
Fields map[string]any
IsDebugRun bool
UserID string
ConnectorID int64
}
type InsertRequest struct {
DatabaseInfoID int64
Fields map[string]any
IsDebugRun bool
UserID string
ConnectorID int64
}