refactor: Update models to use DatabaseV2 instead of DataSourceV2

This commit is contained in:
Marvin Zhang
2024-08-05 13:14:57 +08:00
parent f38b11e7ed
commit fc28a742de
21 changed files with 44 additions and 54 deletions

View File

@@ -28,7 +28,7 @@ func getPostgresqlSession(ctx context.Context, ds *models.DataSource) (s db.Sess
if ds.Host == "" {
host = constants.DefaultHost
}
if ds.Port == "" {
if ds.Port == 0 {
port = constants.DefaultPostgresqlPort
}
@@ -73,7 +73,7 @@ func getPostgresqlSessionV2(ctx context.Context, ds *models2.DatabaseV2) (s db.S
if ds.Host == "" {
host = constants.DefaultHost
}
if ds.Port == "" {
if ds.Port == 0 {
port = constants.DefaultPostgresqlPort
}