mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
SYNC: disable splitting queries with blank lines? #1162
This commit is contained in:
committed by
Diflow
parent
17835832f2
commit
90e4fd7ff5
@@ -279,7 +279,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: {
|
||||||
|
splitterOptions;
|
||||||
|
closeQueryParserWorker();
|
||||||
|
}
|
||||||
$: watchQueryParserWorker(splitterOptions && $tabVisible);
|
$: watchQueryParserWorker(splitterOptions && $tabVisible);
|
||||||
|
|
||||||
|
function closeQueryParserWorker() {
|
||||||
|
if (queryParserWorker) {
|
||||||
|
if (queryParserWorker != 'fallback') {
|
||||||
|
queryParserWorker.terminate();
|
||||||
|
}
|
||||||
|
queryParserWorker = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function watchQueryParserWorker(enabled) {
|
function watchQueryParserWorker(enabled) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
if (!queryParserWorker) {
|
if (!queryParserWorker) {
|
||||||
|
|||||||
@@ -245,6 +245,12 @@ ORDER BY
|
|||||||
label="Show table aliases in code completion"
|
label="Show table aliases in code completion"
|
||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<FormCheckboxField
|
||||||
|
name="sqlEditor.disableSplitByEmptyLine"
|
||||||
|
label="Disable split by empty line"
|
||||||
|
defaultValue={false}
|
||||||
|
/>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
<svelte:fragment slot="2">
|
<svelte:fragment slot="2">
|
||||||
<div class="heading">Connection</div>
|
<div class="heading">Connection</div>
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
import { currentEditorWrapEnabled, extensions, getCurrentDatabase } from '../stores';
|
import { currentEditorWrapEnabled, extensions, getCurrentDatabase } from '../stores';
|
||||||
import applyScriptTemplate from '../utility/applyScriptTemplate';
|
import applyScriptTemplate from '../utility/applyScriptTemplate';
|
||||||
import { changeTab, markTabUnsaved, sleep } from '../utility/common';
|
import { changeTab, markTabUnsaved, sleep } from '../utility/common';
|
||||||
import { getDatabaseInfo, useConnectionInfo } from '../utility/metadataLoaders';
|
import { getDatabaseInfo, useConnectionInfo, useSettings } from '../utility/metadataLoaders';
|
||||||
import SocketMessageView from '../query/SocketMessageView.svelte';
|
import SocketMessageView from '../query/SocketMessageView.svelte';
|
||||||
import useEffect from '../utility/useEffect';
|
import useEffect from '../utility/useEffect';
|
||||||
import ResultTabs from '../query/ResultTabs.svelte';
|
import ResultTabs from '../query/ResultTabs.svelte';
|
||||||
@@ -232,6 +232,8 @@
|
|||||||
return getIntSettingsValue('sqlEditor.limitRows', null, 1);
|
return getIntSettingsValue('sqlEditor.limitRows', null, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const settingsValue = useSettings();
|
||||||
|
|
||||||
let queryRowsLimit = getInitialRowsLimit();
|
let queryRowsLimit = getInitialRowsLimit();
|
||||||
$: localStorage.setItem(queryRowsLimitLocalStorageKey, queryRowsLimit ? queryRowsLimit.toString() : 'nolimit');
|
$: localStorage.setItem(queryRowsLimitLocalStorageKey, queryRowsLimit ? queryRowsLimit.toString() : 'nolimit');
|
||||||
|
|
||||||
@@ -332,7 +334,7 @@
|
|||||||
...driver.getQuerySplitterOptions('editor'),
|
...driver.getQuerySplitterOptions('editor'),
|
||||||
queryParameterStyle,
|
queryParameterStyle,
|
||||||
allowDollarDollarString: false,
|
allowDollarDollarString: false,
|
||||||
splitByEmptyLine: true,
|
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -707,7 +709,10 @@
|
|||||||
engine={$connection && $connection.engine}
|
engine={$connection && $connection.engine}
|
||||||
{conid}
|
{conid}
|
||||||
{database}
|
{database}
|
||||||
splitterOptions={{ ...driver?.getQuerySplitterOptions('editor'), splitByEmptyLine: true }}
|
splitterOptions={{
|
||||||
|
...driver?.getQuerySplitterOptions('editor'),
|
||||||
|
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||||
|
}}
|
||||||
options={{
|
options={{
|
||||||
wrap: enableWrap,
|
wrap: enableWrap,
|
||||||
}}
|
}}
|
||||||
@@ -737,7 +742,10 @@
|
|||||||
<AceEditor
|
<AceEditor
|
||||||
mode={driver?.editorMode || 'sql'}
|
mode={driver?.editorMode || 'sql'}
|
||||||
value={$editorState.value || ''}
|
value={$editorState.value || ''}
|
||||||
splitterOptions={{ ...driver?.getQuerySplitterOptions('editor'), splitByEmptyLine: true }}
|
splitterOptions={{
|
||||||
|
...driver?.getQuerySplitterOptions('editor'),
|
||||||
|
splitByEmptyLine: !$settingsValue?.['sqlEditor.disableSplitByEmptyLine'],
|
||||||
|
}}
|
||||||
options={{
|
options={{
|
||||||
wrap: enableWrap,
|
wrap: enableWrap,
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user