mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 12:33:58 +00:00
allow specify username to redis connection
This commit is contained in:
@@ -81,7 +81,7 @@ function splitCommandLine(str) {
|
|||||||
const driver = {
|
const driver = {
|
||||||
...driverBase,
|
...driverBase,
|
||||||
analyserClass: Analyser,
|
analyserClass: Analyser,
|
||||||
async connect({ server, port, password, database, useDatabaseUrl, databaseUrl, treeKeySeparator }) {
|
async connect({ server, port, user, password, database, useDatabaseUrl, databaseUrl, treeKeySeparator }) {
|
||||||
let db = 0;
|
let db = 0;
|
||||||
let pool;
|
let pool;
|
||||||
if (useDatabaseUrl) {
|
if (useDatabaseUrl) {
|
||||||
@@ -92,6 +92,7 @@ const driver = {
|
|||||||
pool = new Redis({
|
pool = new Redis({
|
||||||
host: server,
|
host: server,
|
||||||
port,
|
port,
|
||||||
|
username: user,
|
||||||
password,
|
password,
|
||||||
db,
|
db,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const driver = {
|
|||||||
if (values.useDatabaseUrl) {
|
if (values.useDatabaseUrl) {
|
||||||
return ['databaseUrl', 'isReadOnly', 'treeKeySeparator'].includes(field);
|
return ['databaseUrl', 'isReadOnly', 'treeKeySeparator'].includes(field);
|
||||||
}
|
}
|
||||||
return ['server', 'port', 'password', 'isReadOnly', 'treeKeySeparator'].includes(field);
|
return ['server', 'port', 'user', 'password', 'isReadOnly', 'treeKeySeparator'].includes(field);
|
||||||
},
|
},
|
||||||
|
|
||||||
showConnectionTab: (field) => field == 'sshTunnel',
|
showConnectionTab: (field) => field == 'sshTunnel',
|
||||||
|
|||||||
Reference in New Issue
Block a user