Skip to content

dbeaver/pro#8821 feat: add import settings step - #4506

Open
SychevAndrey wants to merge 20 commits into
develfrom
8821-customer-wants-import-with-mergeupsert-with-optional-snapshotrollback-safety-net
Open

dbeaver/pro#8821 feat: add import settings step#4506
SychevAndrey wants to merge 20 commits into
develfrom
8821-customer-wants-import-with-mergeupsert-with-optional-snapshotrollback-safety-net

Conversation

@SychevAndrey

Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production

codacy-production Bot commented Jul 29, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 43 complexity · 0 duplication

Metric Results
Complexity 43
Duplication 0

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.

SychevAndrey and others added 4 commits July 29, 2026 12:14
…mergeupsert-with-optional-snapshotrollback-safety-net' into 8821-customer-wants-import-with-mergeupsert-with-optional-snapshotrollback-safety-net
@SychevAndrey SychevAndrey changed the title dbeaver/pro#8821 feat: add gql query for import dbeaver/pro#8821 feat: add import settings step Jul 29, 2026
@SychevAndrey
SychevAndrey marked this pull request as ready for review July 29, 2026 12:45
@SychevAndrey SychevAndrey self-assigned this Jul 29, 2026
Comment thread webapp/packages/plugin-data-import/src/DataImportDriverConfigurationResource.ts Outdated
Comment on lines +33 to +49
function getDefaultSettings(configuration: IDataImportDriverConfiguration): DataTransferImportSettings {
const settings: DataTransferImportSettings = {};

if (configuration.supportsTransactions) {
settings.useTransactions = true;
}

if (configuration.supportedInsertReplaceMethods) {
settings.onDuplicateKeyMethod = undefined;
}

if (configuration.supportsBulkLoad) {
settings.useBulkLoad = false;
}

return settings;
}

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.

it would be nice to have 1 interface with settings so don't need to map it at all

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 got it why this happens:

because getting data and saving data has different interfaces on backend:
dataTransferImportDataIntoResults - saving
IDataImportDriverConfiguration- getting in resource


export interface IDataImportDialogPayload {
tableName: string;
projectId: string;

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.

connectionKey: IConnectionInfoParams?

DataImportDialog,
DataImportDriverConfigurationResource,
createConnectionParam(payload.projectId, payload.connectionId),
{ silent: true },

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.

why silent?

@SychevAndrey SychevAndrey Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe that those setting are kinda optional, so if something goes wrong, we can just skip it. If we show an error or smth, we should think about an action the user can do. Retry to get the driver configuration or what? I would let them go and try import with default settings. And if there is a real problem, they will se an error there

@devnaumov devnaumov Aug 4, 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.

Okay, but its better to default to no options for useResource and .data for getting data from resource

{ silent: true },
);

const driverConfiguration = driverConfigurationResource.tryGetData ?? null;

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.

do we have specific behaviour here? why tryGetData instead of .data?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see the answer above

devnaumov
devnaumov previously approved these changes Aug 4, 2026
…mergeupsert-with-optional-snapshotrollback-safety-net' into 8821-customer-wants-import-with-mergeupsert-with-optional-snapshotrollback-safety-net
@SychevAndrey
SychevAndrey requested a review from devnaumov August 7, 2026 15:57
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