dbeaver/pro#6595 fix: pagination cache (#3886)

dbeaver/pro#6988 fix: allow empty query in VQB
dbeaver/pro#6512 fix: remove bind session from easy config
dbeaver/pro#6734 fix: allowed server urls description

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
Alexey Potsetsuev
2025-11-17 18:52:10 +08:00
committed by GitHub
co-authored by Daria Marutkina
parent 46079dea6a
commit 17331e6a8f
9 changed files with 30 additions and 25 deletions
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ import type { ResourceKeyAlias } from './ResourceKeyAlias.js';
import { isResourceKeyList, resourceKeyList, ResourceKeyList } from './ResourceKeyList.js';
import { ResourceKeyListAlias, resourceKeyListAlias } from './ResourceKeyListAlias.js';
import { ResourceKeyUtils } from './ResourceKeyUtils.js';
import { CachedResourceOffsetPageTargetKey } from './CachedResourceOffsetPageKeys.js';
export type CachedMapResourceKey<TResource> = CachedResourceKey<TResource>;
export type CachedMapResourceValue<TResource> = TResource extends CachedResource<Map<any, infer T>, any, any, any, any> ? T : never;
@@ -64,6 +65,12 @@ export abstract class CachedMapResource<
this.aliases.add(CachedMapAllKey, () => resourceKeyList(this.keys));
this.onItemDelete.addHandler(key => {
ResourceKeyUtils.forEach(key, key => {
this.metadata.delete(CachedResourceOffsetPageTargetKey(key));
});
});
makeObservable<this, 'dataSet' | 'dataDelete'>(this, {
set: action,
delete: action,
@@ -46,7 +46,7 @@ export const ServerConfigurationInfoForm = observer<Props>(function ServerConfig
function constructSupportedHostsExample() {
const exampleWithPort = serverConfigLoader.data?.distributed ? 'localhost' : 'localhost:5000';
return `example.com\n${exampleWithPort}\n127.0.0.1`;
return `example.com\n${exampleWithPort}`;
}
return (
@@ -39,7 +39,7 @@ export default [
['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'],
[
'administration_configuration_wizard_configuration_supported_hosts_description',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.',
],
[
'administration_configuration_wizard_configuration_supported_hosts_warning',
@@ -39,7 +39,7 @@ export default [
['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'],
[
'administration_configuration_wizard_configuration_supported_hosts_description',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.',
],
[
'administration_configuration_wizard_configuration_supported_hosts_warning',
@@ -39,7 +39,7 @@ export default [
['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'],
[
'administration_configuration_wizard_configuration_supported_hosts_description',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.',
],
[
'administration_configuration_wizard_configuration_supported_hosts_warning',
@@ -18,7 +18,7 @@ export default [
['administration_configuration_wizard_configuration_supported_hosts', 'Разрешённые URL сервера'],
[
'administration_configuration_wizard_configuration_supported_hosts_description',
'Вы можете указать несколько URL серверов, разделенных новой строкой. Пустое значение означает, что все URL разрешены',
'Вы можете указать несколько URL серверов, разделенных новой строкой. Пустое значение означает, что все URL разрешены. Доступ с IP-адресов всегда разрешен.',
],
[
'administration_configuration_wizard_configuration_supported_hosts_warning',
@@ -30,7 +30,7 @@ export default [
['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'],
[
'administration_configuration_wizard_configuration_supported_hosts_description',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.',
],
[
'administration_configuration_wizard_configuration_supported_hosts_warning',
@@ -36,7 +36,7 @@ export default [
['administration_configuration_wizard_configuration_supported_hosts', 'Allowed Server URLs'],
[
'administration_configuration_wizard_configuration_supported_hosts_description',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed',
'You can specify multiple server URLs separated by a new line. An empty value means that all URLs are allowed. Access from the IP-addresses is always allowed.',
],
[
'administration_configuration_wizard_configuration_supported_hosts_warning',
@@ -47,7 +47,7 @@ export class SQLParser {
this.script = '';
this.lastParsingArgs = [];
makeObservable<this, '_scripts' | 'script'>(this, {
makeObservable<this, '_scripts' | 'script' | 'getQueryAtPos'>(this, {
actualScript: computed,
_scripts: observable.ref,
script: observable.ref,
@@ -109,22 +109,6 @@ export class SQLParser {
};
}
getQueryAtPos(position: number): ISQLScriptSegment | undefined {
const script = this._scripts.find(script => script.begin <= position && script.end > position);
if (script) {
return script;
}
const closestScripts = this._scripts.filter(script => script.begin <= position);
if (closestScripts.length > 0) {
return closestScripts[closestScripts.length - 1];
}
return undefined;
}
setScript(script: string): void {
this.script = script;
}
@@ -138,4 +122,18 @@ export class SQLParser {
return this;
}
private getQueryAtPos(position: number): ISQLScriptSegment | undefined {
const script = this._scripts.find(script => script.begin <= position && script.end > position);
if (script) {
return script;
}
return {
query: this.actualScript.substring(position, position),
begin: position,
end: position,
};
}
}