Skip to content

Commit cb1f2d8

Browse files
authored
Merge pull request #10 from wp2code/feat_main
Feat main
2 parents 6e8cb62 + aca74c0 commit cb1f2d8

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

src/renderer/src/api/datasource/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export enum DbType {
4646
PostgreSQL = 'PostgreSQL',
4747
Oracle = 'Oracle',
4848
TDengine = 'TDengine',
49+
DM = 'DM',
4950
}
5051
export class SelectDataTableData {
5152
dataSource: DataSource
@@ -60,6 +61,7 @@ export function initDataSource(): DataSource[] {
6061
return [
6162
getDefault(DbType.MySQL),
6263
getDefault(DbType.PostgreSQL),
64+
getDefault(DbType.DM),
6365
// getDefault(DbType.Oracle),
6466
// getDefault(DbType.TDengine),
6567
]
@@ -109,6 +111,17 @@ export function getDefault(dbType: DbType): DataSource {
109111
userName: 'root',
110112
} as DataSource
111113
break
114+
case DbType.DM:
115+
dbConfig = {
116+
type: DbType.DM,
117+
icon: 'DM',
118+
name: '@localhost',
119+
url: 'localhost',
120+
port: 5236,
121+
userName: 'SYSDBA',
122+
dbName: 'DAMENG',
123+
} as DataSource
124+
break
112125
}
113126
return dbConfig
114127
}
Lines changed: 19 additions & 0 deletions
Loading

src/renderer/src/views/code/db/DbConfig.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export enum DbType {
33
PostgreSQL = 'PostgreSQL',
44
Oracle = 'Oracle',
55
TDengine = 'TDengine',
6+
DM = 'DM',
67
}
78
export function getDefault(dbType: DbType): DbConfig {
89
let dbConfig: DbConfig = null
@@ -49,6 +50,18 @@ export function getDefault(dbType: DbType): DbConfig {
4950
'root'
5051
)
5152
break
53+
case DbType.DM:
54+
dbConfig = new DbConfig(
55+
DbType.DM,
56+
'DM',
57+
'@localhost',
58+
'localhost',
59+
5236,
60+
'SYSDBA',
61+
'',
62+
''
63+
)
64+
break
5265
}
5366
return dbConfig
5467
}

0 commit comments

Comments
 (0)