Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8fa4e3a
dbeaver/pro#8044 add api for database user preference
HocKu7 Jan 27, 2026
5d04652
dbeaver/pro#8044 set to prefstore
HocKu7 Jan 29, 2026
1c790a9
dbeaver/pro#8044 add api for database user preference
HocKu7 Jan 30, 2026
1e808bc
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Jan 30, 2026
2787298
dbeaver/pro#8044 add api for database pref
HocKu7 Jan 30, 2026
8db0485
dbeaver/pro#8044 add api for database pref
HocKu7 Feb 2, 2026
f77fd3a
dbeaver/pro#8044 add api for database pref
HocKu7 Feb 3, 2026
03b5746
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Feb 9, 2026
441e4c1
dbeaver/pro#8044 refactor api for database preferences
HocKu7 Feb 9, 2026
b326469
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Feb 9, 2026
0c7aa70
dbeaver/pro#8044 refactor api for database preferences
HocKu7 Feb 10, 2026
f31ae3c
dbeaver/pro#8044 refactor api for database preferences
HocKu7 Feb 10, 2026
6a68aa8
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Mar 17, 2026
569d96d
dbeaver/pro#8044 add api for database user preference
HocKu7 Jan 27, 2026
bebaf1b
dbeaver/pro#8044 set to prefstore
HocKu7 Jan 29, 2026
c15cf8c
dbeaver/pro#8044 add api for database user preference
HocKu7 Jan 30, 2026
a6add64
dbeaver/pro#8044 add api for database pref
HocKu7 Jan 30, 2026
388bc91
dbeaver/pro#8044 add api for database pref
HocKu7 Feb 2, 2026
5e3eaf8
dbeaver/pro#8044 add api for database pref
HocKu7 Feb 3, 2026
d8e2466
dbeaver/pro#8044 refactor api for database preferences
HocKu7 Feb 9, 2026
40694f5
dbeaver/pro#8044 refactor api for database preferences
HocKu7 Feb 10, 2026
b615c64
dbeaver/pro#8044 refactor api for database preferences
HocKu7 Feb 10, 2026
84b4205
Merge remote-tracking branch 'origin/dbeaver/pro#8044-add-api-for-dat…
HocKu7 Mar 19, 2026
c69a24f
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Mar 27, 2026
bf00e1a
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Mar 30, 2026
875adfc
dbeaver/pro#8044 review fixes
HocKu7 Mar 30, 2026
51c7ed9
dbeaver/pro#8044 review fixes
HocKu7 Apr 1, 2026
27f64a1
Merge branch 'devel' into dbeaver/pro#8044-add-api-for-database-user-…
HocKu7 Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2026 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -27,6 +27,7 @@
import org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.registry.DataSourceDescriptor;
import org.jkiss.dbeaver.registry.DataSourcePreferenceStore;
import org.jkiss.utils.CommonUtils;

public class WebConnectionConfigInputHandler<T extends WebConnectionConfig, C extends DataSourceDescriptor> {
Expand Down Expand Up @@ -93,6 +94,9 @@ public void updateDataSource(@NotNull C dataSource) throws DBWebException {
input.isSharedCredentials()
);
dataSource.setConnectionReadOnly(input.isReadOnly());
DataSourcePreferenceStore preferenceStore = dataSource.getPreferenceStore();
preferenceStore.clear();
preferenceStore.setProperties(input.getDefaultUserPreferences());
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2026 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@
import org.jkiss.dbeaver.model.meta.Property;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -64,6 +65,8 @@
private Boolean defaultAutoCommit;
private String defaultCatalogName;
private String defaultSchemaName;
@NotNull
private Map<String, String> defaultUserPreferences = new LinkedHashMap<>();

public WebConnectionConfig() {
}
Expand Down Expand Up @@ -111,6 +114,8 @@
String configType = JSONUtils.getString(params, "configurationType");
configurationType = configType == null ? null : DBPDriverConfigurationType.valueOf(configType);

Map<String, Object> stringObjectUserPrefMap = JSONUtils.getObject(params, "defaultUserPreferences");
stringObjectUserPrefMap.forEach((key, value) -> defaultUserPreferences.put(key, value.toString()));
networkHandlersConfig = new ArrayList<>();
for (Map<String, Object> nhc : JSONUtils.getObjectList(params, "networkHandlersConfig")) {
networkHandlersConfig.add(new WebNetworkHandlerConfigInput(nhc));
Expand Down Expand Up @@ -364,7 +369,16 @@
return defaultSchemaName;
}

public void setDefaultSchemaName(String defaultSchemaName) {

Check warning on line 372 in server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebConnectionConfig.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Reference type 'String' is missing a nullability annotation. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebConnectionConfig.java:372:38: warning: Reference type 'String' is missing a nullability annotation. (sh.adelessfox.checkstyle.checks.NullabilityAnnotationsCheck)
this.defaultSchemaName = defaultSchemaName;
}

@NotNull
public Map<String, String> getDefaultUserPreferences() {
return defaultUserPreferences;
}

public void setDefaultUserPreferences(@NotNull Map<String, String> defaultUserPreferences) {
this.defaultUserPreferences = defaultUserPreferences;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings;
import org.jkiss.dbeaver.model.navigator.DBNDataSource;
import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.preferences.DBPPropertySource;
import org.jkiss.dbeaver.model.rm.RMConstants;
import org.jkiss.dbeaver.model.rm.RMProjectPermission;
import org.jkiss.dbeaver.model.runtime.DBRRunnableParametrized;
import org.jkiss.dbeaver.registry.DataSourcePreferenceStore;
import org.jkiss.dbeaver.registry.network.NetworkHandlerDescriptor;
import org.jkiss.dbeaver.registry.network.NetworkHandlerRegistry;
import org.jkiss.dbeaver.runtime.DBWorkbench;
Expand Down Expand Up @@ -293,6 +295,16 @@ public DBNBrowseSettings getDefaultNavigatorSettings() {
return dataSourceContainer.getNavigatorSettings().getOriginalSettings();
}

@Property
@NotNull
public Map<String, String> getDefaultUserPreferences() {
DBPPreferenceStore preferenceStore = dataSourceContainer.getPreferenceStore();
if (preferenceStore instanceof DataSourcePreferenceStore dataSourcePreferenceStore) {
return dataSourcePreferenceStore.getProperties();
}
return Collections.emptyMap();
}

@Property
@NotNull
public List<WebDataFormat> getSupportedDataFormats() {
Expand Down Expand Up @@ -578,4 +590,5 @@ public List<String> getTools() {
public void setCredentialsSavedInSession(@Nullable Boolean credentialsSavedInSession) {
this.credentialsSavedInSession = credentialsSavedInSession;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ type ConnectionInfo {
requiredAuth: String
defaultCatalogName: String @since(version: "25.0.5")
defaultSchemaName: String @since(version: "25.0.5")
"Default user settings for connection"
defaultUserPreferences: Object @since(version: "26.0.2")

"List of tools that can be used with this connection. Returns empty list if no tools are available"
tools: [String!]! @since(version: "24.1.3")
Expand Down Expand Up @@ -741,6 +743,8 @@ input ConnectionConfig {
defaultCatalogName: String @since(version: "25.0.5") @deprecated(reason: "25.2.1 use expertPropertyValues instead")
"Sets schema name for the connection"
defaultSchemaName: String @since(version: "25.0.5") @deprecated(reason: "25.2.1 use expertPropertyValues instead")
"Default user settings for connection"
defaultUserPreferences: Object @since(version: "26.0.2")
}

####################################################
Expand Down Expand Up @@ -846,6 +850,7 @@ extend type Mutation {
"Sets to default navigator settings for connection. Resets all user navigator settings for this connection."
clearConnectionNavigatorSettings(projectId: ID!, id: ID!): ConnectionInfo! @since(version: "25.3.2")

setObjectSettingsForDatasource(id: ID!, projectId:ID, settings: Object!): Object! @since(version: "25.3.5")
#### Generic async functions

"Cancel async task by ID"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2025 DBeaver Corp and others
* Copyright (C) 2010-2026 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@
import jakarta.servlet.http.HttpServletResponse;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.rm.RMConstants;
import org.jkiss.dbeaver.registry.DataSourceNavigatorSettings;
import org.jkiss.dbeaver.registry.settings.ProductSettingDescriptor;
Expand Down Expand Up @@ -218,6 +219,14 @@ WebConnectionInfo clearConnectionNavigatorSettings(
@NotNull String id
) throws DBWebException;

@NotNull
Map<String, String> setObjectSettingsForDatasource(
@NotNull WebSession webSession,
@NotNull String projectId,
@NotNull String objectId,
@NotNull Map<String, String> settings
) throws DBException;

///////////////////////////////////////////
// Async tasks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ public void bindWiring(DBWBindingContext model) throws DBWebException {
getArgumentVal(env, "id")
)
)
.dataFetcher("setObjectSettingsForDatasource", env -> getService(env).setObjectSettingsForDatasource(
getWebSession(env),
getProjectReference(env),
getArgumentVal(env, "id"),
getArgumentVal(env, "settings")
))

.dataFetcher("asyncTaskInfo", env -> getService(env).getAsyncTaskInfo(
getWebSession(env),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2025 DBeaver Corp and others
* Copyright (C) 2010-2026 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -58,12 +58,14 @@
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.secret.DBSSecretController;
import org.jkiss.dbeaver.model.secret.DBSSecretValue;
import org.jkiss.dbeaver.model.security.SMObjectType;
import org.jkiss.dbeaver.registry.DataSourceDescriptor;
import org.jkiss.dbeaver.registry.DataSourceNavigatorSettings;
import org.jkiss.dbeaver.registry.DataSourceNavigatorSettingsUtils;
import org.jkiss.dbeaver.registry.DataSourceProviderRegistry;
import org.jkiss.dbeaver.registry.network.NetworkHandlerDescriptor;
import org.jkiss.dbeaver.registry.network.NetworkHandlerRegistry;
import org.jkiss.dbeaver.registry.project.BaseProjectSettings;
import org.jkiss.dbeaver.registry.settings.ProductSettingDescriptor;
import org.jkiss.dbeaver.registry.settings.ProductSettingsRegistry;
import org.jkiss.dbeaver.runtime.DBWorkbench;
Expand Down Expand Up @@ -795,9 +797,28 @@
return connectionInfo;
}

@Override
@NotNull
public Map<String, String> setObjectSettingsForDatasource(
@NotNull WebSession webSession,
@NotNull String projectId,
@NotNull String objectId,
@NotNull Map<String, String> settings
) throws DBException {

WebSessionProjectImpl projectById = webSession.getProjectById(projectId);
if (projectById == null) {
throw new DBWebException("Project '" + projectId + "' not found");
}
BaseProjectSettings projectSettings = projectById.getProjectSettings();
projectSettings.setObjectSettings(SMObjectType.datasource, objectId, settings);
Map<String, String> objectSettings = projectSettings.getObjectSettings(SMObjectType.datasource, objectId);
return objectSettings == null ? new HashMap<>() : objectSettings;
}

@Override
public WebAsyncTaskInfo getAsyncTaskInfo(WebSession webSession, String taskId, Boolean removeOnFinish)

Check warning on line 820 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Reference type 'Boolean' is missing a nullability annotation. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java:820:84: warning: Reference type 'Boolean' is missing a nullability annotation. (sh.adelessfox.checkstyle.checks.NullabilityAnnotationsCheck)

Check warning on line 820 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Reference type 'String' is missing a nullability annotation. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java:820:69: warning: Reference type 'String' is missing a nullability annotation. (sh.adelessfox.checkstyle.checks.NullabilityAnnotationsCheck)

Check warning on line 820 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Reference type 'WebSession' is missing a nullability annotation. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java:820:46: warning: Reference type 'WebSession' is missing a nullability annotation. (sh.adelessfox.checkstyle.checks.NullabilityAnnotationsCheck)

Check warning on line 820 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Reference type 'WebAsyncTaskInfo' is missing a nullability annotation. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java:820:12: warning: Reference type 'WebAsyncTaskInfo' is missing a nullability annotation. (sh.adelessfox.checkstyle.checks.NullabilityAnnotationsCheck)
throws DBWebException {

Check warning on line 821 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 'throws' has incorrect indentation level 8, expected level should be 12. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/core/impl/WebServiceCore.java:821:9: warning: 'throws' has incorrect indentation level 8, expected level should be 12. (com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck)
return webSession.asyncTaskStatus(taskId, CommonUtils.toBoolean(removeOnFinish));
}

Expand Down
Loading