mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 00:45:58 +00:00
Merge branch 'master' of github.com:dbgate/dbgate
This commit is contained in:
@@ -48,16 +48,17 @@ const driver = {
|
|||||||
...driverBase,
|
...driverBase,
|
||||||
analyserClass: Analyser,
|
analyserClass: Analyser,
|
||||||
async connect({ server, port, user, password, database, useDatabaseUrl, databaseUrl, ssl }) {
|
async connect({ server, port, user, password, database, useDatabaseUrl, databaseUrl, ssl }) {
|
||||||
// let mongoUrl = databaseUrl;
|
let mongoUrl;
|
||||||
// if (!useDatabaseUrl) {
|
if (useDatabaseUrl) {
|
||||||
// mongoUrl = user ? `mongodb://${user}:${password}@${server}:${port}` : `mongodb://${server}:${port}`;
|
// change port to ssh tunnel port
|
||||||
// if (database) mongoUrl += '/' + database;
|
const url = new URL(databaseUrl);
|
||||||
// }
|
url.port = port;
|
||||||
const mongoUrl = useDatabaseUrl
|
mongoUrl = url.href;
|
||||||
? databaseUrl
|
} else {
|
||||||
: user
|
mongoUrl = user
|
||||||
? `mongodb://${user}:${password}@${server}:${port}`
|
? `mongodb://${user}:${password}@${server}:${port}`
|
||||||
: `mongodb://${server}:${port}`;
|
: `mongodb://${server}:${port}`;
|
||||||
|
}
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user