Skip to content

Commit 2fcef8d

Browse files
authored
Merge pull request #573 from rocket-admin/backend_development
added data access object mongodb
2 parents d0206e3 + acf6a8e commit 2fcef8d

File tree

18 files changed

+4397
-301
lines changed

18 files changed

+4397
-301
lines changed

backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"lodash": "4.17.21",
9090
"lru-cache": "^10.1.0",
9191
"moment": "2.29.4",
92+
"mongodb": "^6.5.0",
9293
"nanoid": "5.0.4",
9394
"nest-winston": "1.9.4",
9495
"node-gyp": "^10.0.1",

backend/src/entities/table/use-cases/export-csv-from-table.use.case.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ export class ExportCSVFromTableUseCase extends AbstractUseCase<GetTableRowsDs, a
8787
//todo: rework as streams when node oracle driver will support it correctly
8888
//todo: agent return data as array of table rows, not as stream, because we cant
8989
//todo: transfer data as a stream from clint to server
90-
if (connection.type === 'oracledb' || connection.type === 'ibmdb2' || isConnectionTypeAgent(connection.type)) {
90+
if (
91+
connection.type === 'oracledb' ||
92+
connection.type === 'ibmdb2' ||
93+
connection.type === 'mongodb' ||
94+
isConnectionTypeAgent(connection.type)
95+
) {
9196
return new StreamableFile(csv.stringify(rowsStream as any, { header: true }));
9297
}
9398
return new StreamableFile(rowsStream.pipe(csv.stringify({ header: true })));

backend/src/enums/connection-type.enum.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ export enum ConnectionTypeTestEnum {
55
oracledb = 'oracledb',
66
mssql = 'mssql',
77
ibmdb2 = 'ibmdb2',
8+
mongodb = 'mongodb',
89
agent_postgres = 'agent_postgres',
910
agent_mysql = 'agent_mysql',
1011
agent_oracledb = 'agent_oracledb',
1112
agent_mssql = 'agent_mssql',
1213
agent_ibmdb2 = 'agent_ibmdb2',
14+
agent_mongodb = 'agent_mongodb',
1315
cli_postgres = 'cli_postgres',
1416
cli_mysql = 'cli_mysql',
1517
cli_oracledb = 'cli_oracledb',
1618
cli_mssql = 'cli_mssql',
1719
cli_ibmdb2 = 'cli_ibmdb2',
20+
cli_mongodb = 'cli_mongodb',
1821
}

0 commit comments

Comments
 (0)