Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: renmae TableTypeNone to TableTypeUnknown (#2071)
rebelice6c6dc7a7e4ec
diff --git a/plugin/parser/ast/table_def.go b/plugin/parser/ast/table_def.goindex cedab3da2c..04db7021dd 100644--- a/plugin/parser/ast/table_def.go+++ b/plugin/parser/ast/table_def.go@@ -4,8 +4,8 @@ package asttype TableType intconst (- // TableTypeNone is the type for table or view, which means we can't be sure of it.- TableTypeNone TableType = iota+ // TableTypeUnknown is the type for table or view, which means we can't be sure of it.+ TableTypeUnknown TableType = iota// TableTypeBaseTable is the type for table.TableTypeBaseTable// TableTypeView is the type for view.diff --git a/plugin/parser/engine/pg/convert.go b/plugin/parser/engine/pg/convert.goindex ee3c1389ab..800a033c44 100644--- a/plugin/parser/engine/pg/convert.go+++ b/plugin/parser/engine/pg/convert.go@@ -139,14 +139,14 @@ func convert(node *pgquery.Node, text string) (res ast.Node, err error) {}, nilcase pgquery.ObjectType_OBJECT_INDEX:return &ast.RenameIndexStmt{- Table: convertRangeVarToIndexTableName(in.RenameStmt.Relation, ast.TableTypeNone),+ Table: convertRangeVarToIndexTableName(in.RenameStmt.Relation, ast.TableTypeUnknown),IndexName: in.RenameStmt.Relation.Relname,NewName: in.RenameStmt.Newname,}, nil}case *pgquery.Node_IndexStmt:indexDef := &ast.IndexDef{- Table: convertRangeVarToTableName(in.IndexStmt.Relation, ast.TableTypeNone),+ Table: convertRangeVarToTableName(in.IndexStmt.Relation, ast.TableTypeUnknown),Name: in.IndexStmt.Idxname,Unique: in.IndexStmt.Unique,}@@ -180,7 +180,7 @@ func convert(node *pgquery.Node, text string) (res ast.Node, err error) {if !ok {return nil, parser.NewConvertErrorf("expected List but found %t", object.Node)}- indexDef, err := convertListToIndexDef(list, ast.TableTypeNone)+ indexDef, err := convertListToIndexDef(list, ast.TableTypeUnknown)if err != nil {return nil, err}@@ -581,6 +581,6 @@ func convertToTableType(relationType pgquery.ObjectType) (ast.TableType, error)case pgquery.ObjectType_OBJECT_VIEW:return ast.TableTypeView, nildefault:- return ast.TableTypeNone, parser.NewConvertErrorf("expected TABLE or VIEW but found %s", relationType)+ return ast.TableTypeUnknown, parser.NewConvertErrorf("expected TABLE or VIEW but found %s", relationType)}}