Skip to content

4551 generate full ddl for postgresql metaobjects - #4507

Open
sergeyteleshev wants to merge 12 commits into
develfrom
4551-generate-full-ddl-for-postgresql-metaobjects
Open

4551 generate full ddl for postgresql metaobjects#4507
sergeyteleshev wants to merge 12 commits into
develfrom
4551-generate-full-ddl-for-postgresql-metaobjects

Conversation

@sergeyteleshev

@sergeyteleshev sergeyteleshev commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

closes https://github.com/dbeaver/pro/issues/4551

metadataGetNodeDDL & sqlGenerateEntityQuery - these queries basically do the same, so backend introduced asyncSqlGenerateEntityQuery (which allows to get heavy queries as well) and we need to use only it so we don't have any code & logic duplications

also I have introduced new plugin core-sql-generator and moved the resource there so we don't have to import plugin-sql-generator into plugin-ddl-viewer. these 2 plugins already have enough deps with sql-editor and data-editor. by that we reduce probability of a circular deps plugins import in the future

@sergeyteleshev sergeyteleshev self-assigned this Jul 29, 2026
@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 31 complexity

Metric Results
Complexity 31

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.

@sergeyteleshev
sergeyteleshev marked this pull request as ready for review July 29, 2026 11:26
Comment on lines +61 to +83
async function loadDdl(showFullDdl: boolean) {
if (!ddlGenerator) {
return;
}

setDdlLoading(true);
try {
const newQuery = await sqlGeneratorsResource.resource.generateEntityQuery(ddlGenerator.id, nodeId, {
...getDefaultQueryGeneratorOptions(),
showFullDdl,
});
setQuery(newQuery);
} catch (error: any) {
notificationService.logException(error, 'plugin_ddl_viewer_full_ddl_error_title');
} finally {
setDdlLoading(false);
}
}

useEffect(() => {
if (ddlGenerator) {
loadDdl(isFullDdl);
}

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.

looks like it should be a separate resource or at least a part of SqlGeneratorsResource.

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.

nice catch! moved it to a separate resource so we can reuse its all features we need in this component

SychevAndrey
SychevAndrey previously approved these changes Aug 4, 2026
Comment thread webapp/packages/core-sql-generator/src/module.ts Outdated
Comment thread webapp/packages/plugin-sql-generator/src/SqlGenerators/GeneratedSqlDialog.tsx Outdated
Comment thread webapp/packages/plugin-ddl-viewer/src/DdlViewer/DDLQueryStateService.ts Outdated
devnaumov
devnaumov previously approved these changes Aug 6, 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.

4 participants