!93 feat: DBMS支持mssql和一些功能优化

* feat: 表格+表格元数据缓存
* feat:跳板机支持多段跳
* fix: 所有数据库区分字段主键和自增
* feat: DBMS支持mssql
* refactor: 去除无用的getter方法
This commit is contained in:
zongyangleo
2024-01-29 04:20:23 +00:00
committed by Coder慌
parent 923e183a67
commit 0e6b9713ce
59 changed files with 1506 additions and 433 deletions

View File

@@ -91,7 +91,8 @@ func (md *PgsqlDialect) GetColumns(tableNames ...string) ([]dbi.Column, error) {
ColumnType: anyx.ConvString(re["columnType"]),
ColumnComment: anyx.ConvString(re["columnComment"]),
Nullable: anyx.ConvString(re["nullable"]),
ColumnKey: anyx.ConvString(re["columnKey"]),
IsPrimaryKey: anyx.ConvInt(re["isPrimaryKey"]) == 1,
IsIdentity: anyx.ConvInt(re["isIdentity"]) == 1,
ColumnDefault: anyx.ConvString(re["columnDefault"]),
NumScale: anyx.ConvString(re["numScale"]),
})
@@ -108,7 +109,7 @@ func (md *PgsqlDialect) GetPrimaryKey(tablename string) (string, error) {
return "", errorx.NewBiz("[%s] 表不存在", tablename)
}
for _, v := range columns {
if v.ColumnKey == "PRI" {
if v.IsPrimaryKey {
return v.ColumnName, nil
}
}
@@ -130,7 +131,7 @@ func (md *PgsqlDialect) GetTableIndex(tableName string) ([]dbi.Index, error) {
ColumnName: anyx.ConvString(re["columnName"]),
IndexType: anyx.ConvString(re["IndexType"]),
IndexComment: anyx.ConvString(re["indexComment"]),
NonUnique: anyx.ConvInt(re["nonUnique"]),
IsUnique: anyx.ConvInt(re["isUnique"]) == 1,
SeqInIndex: anyx.ConvInt(re["seqInIndex"]),
})
}