Skip to content

dbeaver/pro#9652 refactor ref api#4412

Open
HocKu7 wants to merge 23 commits into
develfrom
dbeaver/pro#9652-refactor-ref-api
Open

dbeaver/pro#9652 refactor ref api#4412
HocKu7 wants to merge 23 commits into
develfrom
dbeaver/pro#9652-refactor-ref-api

Conversation

@HocKu7

@HocKu7 HocKu7 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@codacy-production

codacy-production Bot commented Jun 19, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 medium · 1 minor

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
CodeStyle 1 minor
Complexity 1 medium

View in Codacy

🟢 Metrics 80 complexity · -5 duplication

Metric Results
Complexity 80
Duplication -5

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.

@HocKu7 HocKu7 force-pushed the dbeaver/pro#9652-refactor-ref-api branch from 64dc0dd to ea85e9c Compare June 19, 2026 14:35
serge-rider
serge-rider previously approved these changes Jun 23, 2026
return where;
}

public boolean isAnyConstraint() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is this? Add javadoc pls


type SQLResultReference @since(version: "26.1.1") {
"True for reverse references (incoming FKs)"
isReference: Boolean!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isReference -> reference

}

"Pair (source-row column index, target-entity column name) used to build a navigation filter"
type SQLReferenceColumnMapping @since(version: "26.1.1") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

26.1.2

state.association = defaultAssociation.associationName;
}

//@TODO Find a better way to check whether model is ready to be used

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 there a separate task or will be fixed here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Separate

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.

please link a task

Comment thread webapp/packages/plugin-data-viewer-references/src/useReferencesDataModel.ts Outdated
Comment thread webapp/packages/plugin-data-viewer-references/src/useReferencesDataModel.ts Outdated
Comment thread webapp/packages/plugin-data-viewer-references/src/useReferencesDataModel.ts Outdated

function openAssociation() {
if (!currentAssociation?.targetNodePath) {
throw new Error('Target node path is not defined');

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.

this things like throw new Error on layout level usually breaks a whole layout. did you test this case? what will happen? I suppose like notification or StatusMessage is more than enough in most cases

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This case is never going to happen as we render open button only if currentAssociation is presented

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'm speaking from experience here. All of these cases we had this throw new Error() we had and which are never supposed to happen usually happens. Then we create a ticket for that and fix the issue with replacing this error with:

  1. early return
  2. log or notification or status message

I personally fixed at least 2-3 bugs like this during this year. So all I'm saying is after few iterations with this feature, this may happen. Right now we can fix it quite cheap since we noticed it pretty early

Comment on lines +100 to +104
{currentAssociation.targetNodePath && (
<Button size="small" variant="secondary" onClick={openAssociation}>
{translate('ui_open')}
</Button>
)}

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.

lets always show the button so the interface don't jump
but disable it if no target node path or something is loading

@devnaumov devnaumov Jun 26, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be strange, user will see a button but would not be able to click it. TargetNodePath should be provided as we are fetching result based on that

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.

okay. my concern here is so user can't press it if something is loading and that there are not blinking interface
if you think its fine I'm good with that

asyncTaskInfoService: AsyncTaskInfoService,
) {
super(serviceProvider, graphQLService, asyncTaskInfoService, connectionExecutionContextService);
this.setFeature(DatabaseDataFeature.References);

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 can see that it is not reused any where (only few places to show/hide the feature itself). this means reference panel table cells probably has no actions can be applied via context menu or shortcuts

is this expected?

since it is ResultSet I would also try to add References in the implementations of ResultSet with allowedFeatures arrays. and check if features works correct here. if something is broken we can remove it or comment + add the ticket to fix it

the point is to add a functionality from the start what we can afford, without going too deep into it right now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I dont follow the logic, we set feature here so we dont need to check instance of source, the same way we do for grouping panel

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.

okay lets leave DatabaseDataFeature.References it is fine and expected
what about context menu and shortcuts? can we add something so its not empty? like generate sql or sorting if it is possible

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have sorting, I checked grouping panel and we have the same actions there. Probably we should create a ticket and add more actions to grouping panel and references panel

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.

okay lets go with the ticket then

SychevAndrey
SychevAndrey previously approved these changes Jun 26, 2026
state.association = defaultAssociation.associationName;
}

//@TODO Find a better way to check whether model is ready to be used

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.

please link a task

sergeyteleshev
sergeyteleshev previously approved these changes Jun 26, 2026
yagudin10
yagudin10 previously approved these changes Jun 26, 2026
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.

6 participants