From 9ed1cdf4b78577175c933c983f2f5ddcbd3f3c60 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Wed, 28 Sep 2022 18:18:03 +0200 Subject: [PATCH] redis key separator fix #379 --- plugins/dbgate-plugin-redis/src/backend/driver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/dbgate-plugin-redis/src/backend/driver.js b/plugins/dbgate-plugin-redis/src/backend/driver.js index ab03f55f..eec7d4ca 100644 --- a/plugins/dbgate-plugin-redis/src/backend/driver.js +++ b/plugins/dbgate-plugin-redis/src/backend/driver.js @@ -147,7 +147,7 @@ const driver = { info .split('\n') .filter((x) => x.trim() && !x.trim().startsWith('#')) - .map((x) => x.split(pool.__treeKeySeparator)) + .map((x) => x.split(':')) ); }, async getVersion(pool) { @@ -167,7 +167,7 @@ const driver = { async loadKeys(pool, root = '', filter = null) { const keys = await this.getKeys(pool, root ? `${root}${pool.__treeKeySeparator}*` : '*'); const keysFiltered = keys.filter((x) => filterName(filter, x)); - const res = this.extractKeysFromLevel(root, keysFiltered); + const res = this.extractKeysFromLevel(pool, root, keysFiltered); await this.enrichKeyInfo(pool, res); return res; }, @@ -197,7 +197,7 @@ const driver = { return res; }, - extractKeysFromLevel(root, keys) { + extractKeysFromLevel(pool, root, keys) { const prefix = root ? `${root}${pool.__treeKeySeparator}` : ''; const rootSplit = _.compact(root.split(pool.__treeKeySeparator)); const res = {};