better editor SQL splitting

This commit is contained in:
Jan Prochazka
2022-09-28 12:24:06 +02:00
parent 8ce5e68c0d
commit c5a7f458ba
17 changed files with 39 additions and 24 deletions

View File

@@ -31,7 +31,7 @@
},
"devDependencies": {
"dbgate-plugin-tools": "^1.0.7",
"dbgate-query-splitter": "^4.9.0",
"dbgate-query-splitter": "^4.9.2",
"dbgate-tools": "^5.0.0-alpha.1",
"lodash": "^4.17.21",
"pg": "^8.7.1",

View File

@@ -105,7 +105,10 @@ const postgresDriverBase = {
dialect,
// showConnectionField: (field, values) =>
// ['server', 'port', 'user', 'password', 'defaultDatabase', 'singleDatabase'].includes(field),
getQuerySplitterOptions: () => postgreSplitterOptions,
getQuerySplitterOptions: usage =>
usage == 'editor'
? { ...postgreSplitterOptions, ignoreComments: true, preventSingleLineSplit: true }
: postgreSplitterOptions,
readOnlySessions: true,
databaseUrlPlaceholder: 'e.g. postgresql://user:password@localhost:5432/default_database',