{
- skip += limit;
+ skip = parseInt(skip) + parseInt(limit);
dispatch('load');
}}
>
diff --git a/packages/web/src/modals/InsertJoinModal.svelte b/packages/web/src/modals/InsertJoinModal.svelte
index ed19eb7b..e1cd0177 100644
--- a/packages/web/src/modals/InsertJoinModal.svelte
+++ b/packages/web/src/modals/InsertJoinModal.svelte
@@ -1,4 +1,5 @@
-
+ |
{#if value !== undefined}
{#if displayType == 'json'}
@@ -23,6 +23,8 @@
{:else}
(no image)
{/if}
+ {:else if _.isArray(value) || _.isPlainObject(value)}
+
{:else}
{/if}
diff --git a/packages/web/src/perspectives/PerspectiveTable.svelte b/packages/web/src/perspectives/PerspectiveTable.svelte
index 4f7990c4..32a9b97d 100644
--- a/packages/web/src/perspectives/PerspectiveTable.svelte
+++ b/packages/web/src/perspectives/PerspectiveTable.svelte
@@ -57,6 +57,7 @@
let errorMessage;
let rowCount;
let isLoading = false;
+ let isLoadQueued = false;
const lastVisibleRowIndexRef = createRef(0);
const disableLoadNextRef = createRef(false);
@@ -121,6 +122,12 @@
}
async function loadData(node: PerspectiveTreeNode, counts) {
+ if (isLoading) {
+ isLoadQueued = true;
+ return;
+ } else {
+ isLoadQueued = false;
+ }
// console.log('LOADING', node);
if (!node) return;
const rows = [];
@@ -147,6 +154,10 @@
// loadProps.push(child.getNodeLoadProps());
// }
// }
+
+ if (isLoadQueued) {
+ loadData(root, $loadedCounts);
+ }
}
export function openJson() {
diff --git a/packages/web/src/query/codeCompletion.ts b/packages/web/src/query/codeCompletion.ts
index e59503b5..ddb66209 100644
--- a/packages/web/src/query/codeCompletion.ts
+++ b/packages/web/src/query/codeCompletion.ts
@@ -2,6 +2,7 @@ import _ from 'lodash';
import { addCompleter, setCompleters } from 'ace-builds/src-noconflict/ext-language_tools';
import { getDatabaseInfo } from '../utility/metadataLoaders';
import analyseQuerySources from './analyseQuerySources';
+import { getStringSettingsValue } from '../settings/settingsTools';
const COMMON_KEYWORDS = [
'select',
@@ -78,13 +79,21 @@ export function mountCodeCompletion({ conid, database, editor, getText }) {
const line = session.getLine(cursor.row).slice(0, cursor.column);
const dbinfo = await getDatabaseInfo({ conid, database });
- let list = COMMON_KEYWORDS.map(word => ({
- name: word,
- value: word,
- caption: word,
- meta: 'keyword',
- score: 800,
- }));
+ const convertUpper = getStringSettingsValue('sqlEditor.sqlCommandsCase', 'upperCase') == 'upperCase';
+
+ let list = COMMON_KEYWORDS.map(word => {
+ if (convertUpper) {
+ word = word.toUpperCase();
+ }
+
+ return {
+ name: word,
+ value: word,
+ caption: word,
+ meta: 'keyword',
+ score: 800,
+ };
+ });
if (dbinfo) {
const colMatch = line.match(/([a-zA-Z0-9_]+)\.([a-zA-Z0-9_]*)?$/);
diff --git a/packages/web/src/settings/SettingsModal.svelte b/packages/web/src/settings/SettingsModal.svelte
index 99e0ca35..ebf2d9a1 100644
--- a/packages/web/src/settings/SettingsModal.svelte
+++ b/packages/web/src/settings/SettingsModal.svelte
@@ -111,6 +111,19 @@ ORDER BY
defaultValue="30"
disabled={values['connection.autoRefresh'] === false}
/>
+
+ SQL editor
+
+
Application theme
diff --git a/packages/web/src/settings/settingsTools.ts b/packages/web/src/settings/settingsTools.ts
index 7c27ad20..dbf739ee 100644
--- a/packages/web/src/settings/settingsTools.ts
+++ b/packages/web/src/settings/settingsTools.ts
@@ -21,3 +21,10 @@ export function getBoolSettingsValue(name, defaultValue) {
if (res == null) return defaultValue;
return !!res;
}
+
+export function getStringSettingsValue(name, defaultValue) {
+ const settings = getCurrentSettings();
+ const res = settings[name];
+ if (res == null) return defaultValue;
+ return res;
+}
diff --git a/packages/web/src/utility/SettingsListener.svelte b/packages/web/src/utility/SettingsListener.svelte
new file mode 100644
index 00000000..7dedd6a8
--- /dev/null
+++ b/packages/web/src/utility/SettingsListener.svelte
@@ -0,0 +1,8 @@
+
diff --git a/plugins/dbgate-plugin-mongo/src/backend/driver.js b/plugins/dbgate-plugin-mongo/src/backend/driver.js
index a120145d..432593d4 100644
--- a/plugins/dbgate-plugin-mongo/src/backend/driver.js
+++ b/plugins/dbgate-plugin-mongo/src/backend/driver.js
@@ -9,7 +9,9 @@ const AbstractCursor = require('mongodb').AbstractCursor;
const createBulkInsertStream = require('./createBulkInsertStream');
function transformMongoData(row) {
- return _.mapValues(row, (v) => (v && v.constructor == ObjectId ? { $oid: v.toString() } : v));
+ return _.cloneDeepWith(row, (x) => {
+ if (x && x.constructor == ObjectId) return { $oid: x.toString() };
+ });
}
async function readCursor(cursor, options) {
|