refactor(workflow): Move the database component in the Workflow package into the common crossdomain package (#704)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user