mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 04:26:01 +00:00
redis connection
This commit is contained in:
30
plugins/dbgate-plugin-redis/src/frontend/driver.js
Normal file
30
plugins/dbgate-plugin-redis/src/frontend/driver.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const { driverBase } = global.DBGATE_TOOLS;
|
||||
const Dumper = require('./Dumper');
|
||||
|
||||
/** @type {import('dbgate-types').SqlDialect} */
|
||||
const dialect = {
|
||||
limitSelect: true,
|
||||
rangeSelect: true,
|
||||
offsetFetchRangeSyntax: true,
|
||||
stringEscapeChar: "'",
|
||||
fallbackDataType: 'nvarchar(max)',
|
||||
quoteIdentifier(s) {
|
||||
return `[${s}]`;
|
||||
},
|
||||
};
|
||||
|
||||
/** @type {import('dbgate-types').EngineDriver} */
|
||||
const driver = {
|
||||
...driverBase,
|
||||
dumperClass: Dumper,
|
||||
dialect,
|
||||
engine: 'redis@dbgate-plugin-redis',
|
||||
title: 'Redis',
|
||||
defaultPort: 6379,
|
||||
|
||||
showConnectionField: (field, values) => {
|
||||
return ['server', 'port', 'password'].includes(field);
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = driver;
|
||||
Reference in New Issue
Block a user