Skip to content

dbeaver/pro#9614 add predefined param for connection type#4454

Open
devnaumov wants to merge 11 commits into
develfrom
dbeaver/pro#9614-connection-types
Open

dbeaver/pro#9614 add predefined param for connection type#4454
devnaumov wants to merge 11 commits into
develfrom
dbeaver/pro#9614-connection-types

Conversation

@devnaumov

Copy link
Copy Markdown
Member

closes 9614

@codacy-production

codacy-production Bot commented Jul 7, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 77 complexity

Metric Results
Complexity 77

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread webapp/packages/core-app/src/Body.tsx Outdated
Comment thread webapp/packages/core-ui/src/Tabs/Tab/Tab.module.css
Comment thread webapp/packages/core-connections/package.json
@devnaumov devnaumov requested a review from sergeyteleshev July 9, 2026 15:04
return;
}

const typeIds: string[] = [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Set for O(1) search

sergeyteleshev
sergeyteleshev previously approved these changes Jul 9, 2026
}

override async load(): Promise<void> {
await this.connectionTypeResource.load(CachedMapAllKey);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really have to block the loading? why not to do it lazy? plus we don't handle errors here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont understand the question. We need to make sure connection types are loaded as soon as possible

Comment on lines +35 to +40
this.sync(
sessionResource,
() => {},
() => CachedMapAllKey,
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need it?
all connection should already be synced with the app, so we need to only sync with connections themselves

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If sessionResource is outdated, we want connection types to be marked as outdated as well

@SychevAndrey SychevAndrey Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want it? Session resource has fields like language, why do we need to mark all connection types as outdated when we change it?


const context = data.model.dataSource?.executionContext;
if (context) {
typeColor = connectionTypeService.getConnectionTypeColor(createConnectionParam(context.projectId, context.connectionId));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not webapp/packages/core-connections/src/ConnectionType/useConnectionTypeColor.ts ?

let typeColor: string | undefined;

if (executionContext) {
typeColor = connectionTypeService.getConnectionTypeColor(createConnectionParam(executionContext.projectId, executionContext.connectionId));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should use the hook in tsx components since it's introduced in this PR

return null;
}

const typeColor = connectionTypeService.getConnectionTypeColor(connectionKey);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useConnectionTypeColor

color = connectionType.colorDark;
}

color = color ?? connectionType.colorLight;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this fallback for?

color is already colorLight if we don't have colorDark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants