feat: 新增机器授权凭证管理与其他优化

This commit is contained in:
meilin.huang
2023-03-06 16:59:57 +08:00
parent 7c086bbec8
commit 0695ad9a85
73 changed files with 1666 additions and 811 deletions

View File

@@ -18,7 +18,7 @@ import (
func getPgsqlDB(d *entity.Db, db string) (*sql.DB, error) {
driverName := d.Type
// SSH Conect
if d.EnableSshTunnel == 1 && d.SshTunnelMachineId != 0 {
if d.SshTunnelMachineId > 0 {
// 如果使用了隧道,则使用`postgres:ssh:隧道机器id`注册名
driverName = fmt.Sprintf("postgres:ssh:%d", d.SshTunnelMachineId)
if !utils.ArrContains(sql.Drivers(), driverName) {
@@ -36,7 +36,7 @@ func getPgsqlDB(d *entity.Db, db string) (*sql.DB, error) {
// pgsql dialer
type PqSqlDialer struct {
sshTunnelMachineId uint64
sshTunnelMachineId int
}
func (d *PqSqlDialer) Open(name string) (driver.Conn, error) {