From 46ac931ecba9512bfc82f1ac7e7be33a41794263 Mon Sep 17 00:00:00 2001 From: wangyue Date: Wed, 31 Jan 2024 16:24:41 +0800 Subject: [PATCH] Feat actiontech/dms-ee/issues/125: add SQLObjectTypeServer and some help func --- sqle/driver/v2/driver_interface.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sqle/driver/v2/driver_interface.go b/sqle/driver/v2/driver_interface.go index 60f78b0b06..36078686be 100644 --- a/sqle/driver/v2/driver_interface.go +++ b/sqle/driver/v2/driver_interface.go @@ -315,6 +315,17 @@ type SQLObjectOps struct { Sql SQLInfo } +func NewSQLObjectOps(sql string) *SQLObjectOps { + return &SQLObjectOps{ + ObjectOps: []*SQLObjectOp{}, + Sql: SQLInfo{Sql: sql}, + } +} + +func (s *SQLObjectOps) AddObjectOp(o ...*SQLObjectOp) { + s.ObjectOps = append(s.ObjectOps, o...) +} + type SQLObjectOp struct { Op SQLOp // 对象操作 Object *SQLObject // 对象 @@ -335,6 +346,7 @@ const ( SQLObjectTypeTable SQLObjectType = "Table" SQLObjectTypeSchema SQLObjectType = "Schema" SQLObjectTypeInstance SQLObjectType = "Instance" + SQLObjectTypeServer SQLObjectType = "Server" ) type SQLInfo struct {