fix: pgsql主键字段获取修复

This commit is contained in:
meilin.huang
2023-01-09 20:05:35 +08:00
parent 11148e720b
commit 2a91cdb67a
3 changed files with 9 additions and 9 deletions

View File

@@ -28,8 +28,8 @@
"vue-clipboard3": "^1.0.1",
"vue-router": "^4.1.6",
"vuex": "^4.0.2",
"xterm": "^5.0.0",
"xterm-addon-fit": "^0.6.0"
"xterm": "^5.1.0",
"xterm-addon-fit": "^0.7.0"
},
"devDependencies": {
"@types/lodash": "^4.14.178",

View File

@@ -8,14 +8,14 @@ require (
github.com/go-sql-driver/mysql v1.7.0
github.com/golang-jwt/jwt/v4 v4.4.3
github.com/gorilla/websocket v1.5.0
github.com/lib/pq v1.10.6
github.com/lib/pq v1.10.7
github.com/mojocn/base64Captcha v1.3.5 //
github.com/pkg/sftp v1.13.5
github.com/robfig/cron/v3 v3.0.1 //
github.com/sirupsen/logrus v1.9.0
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
go.mongodb.org/mongo-driver v1.11.0 // mongo
golang.org/x/crypto v0.4.0 // ssh
go.mongodb.org/mongo-driver v1.11.1 // mongo
golang.org/x/crypto v0.5.0 // ssh
gopkg.in/yaml.v3 v3.0.1
// gorm
gorm.io/driver/mysql v1.4.4
@@ -50,10 +50,10 @@ require (
github.com/xdg-go/stringprep v1.0.3 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect

View File

@@ -72,7 +72,7 @@ const (
A.attname AS "columnName",
tc.is_nullable AS "nullable",
concat_ws ( '', t.typname, SUBSTRING ( format_type ( a.atttypid, a.atttypmod ) FROM '\(.*\)' ) ) AS "columnType",
(CASE WHEN ( SELECT COUNT(*) FROM pg_constraint WHERE conrelid = a.attrelid AND conkey[1]= attnum AND contype = 'p' ) > 0 THEN 'PRI' ELSE '' END ) AS columnKey,
(CASE WHEN ( SELECT COUNT(*) FROM pg_constraint WHERE conrelid = a.attrelid AND conkey[1]= attnum AND contype = 'p' ) > 0 THEN 'PRI' ELSE '' END ) AS "columnKey",
d.description AS "columnComment"
FROM
pg_attribute a LEFT JOIN pg_description d ON d.objoid = a.attrelid