Skip to content

Create Sql-query-runner Dialog#218

Open
ivy-tgr wants to merge 1 commit into
masterfrom
XIVY-18080-SQL-Editor
Open

Create Sql-query-runner Dialog#218
ivy-tgr wants to merge 1 commit into
masterfrom
XIVY-18080-SQL-Editor

Conversation

@ivy-tgr

@ivy-tgr ivy-tgr commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@ivy-tgr ivy-tgr force-pushed the XIVY-18080-SQL-Editor branch 7 times, most recently from 3d27849 to aaad906 Compare June 24, 2026 13:38
@ivy-tgr ivy-tgr requested a review from ivy-edp June 24, 2026 13:39
@ivy-tgr ivy-tgr marked this pull request as ready for review June 24, 2026 13:39
@ivy-tgr ivy-tgr requested a review from ivy-fhe as a code owner June 24, 2026 13:39

@ivy-edp ivy-edp left a comment

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.

In general okay, however some comments to address/improve

Comment thread packages/database-editor/src/components/editor/master/DatabaseMasterContent.tsx Outdated
Comment thread packages/database-editor/src/components/editor/master/MasterControl.tsx Outdated

const tablesQuery = useMeta('meta/databaseTableNames', { ...context, databaseName: database.name });

const executeSqlMutation = useMutation({

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.

A custom useFunction hook would make sense here (similar to the one used in the Form Editor), since we now have at least two places in the Database Editor that use this functionality. Extracting it into a hook would simplify calling function endpoints and help avoid duplicated logic.

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.

Should I also rewrite the existing two function calls so they also use UseFunction?

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.

Yes i would 👍

Comment thread packages/database-editor/src/DatabaseEditor.tsx Outdated
Comment thread packages/protocol/schemaCodegen.cjs Outdated
Comment thread packages/database-editor/src/components/SqlQueryTester/SqlQueryContent.tsx Outdated
Comment thread playwright/tests/integration/sql-execution.spec.ts
Comment thread playwright/tests/pageobjects/main/MainPanel.ts Outdated
/>
)}
<Flex direction='row' justifyContent='space-between' alignItems='center' gap={2}>
<Input

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 wouldn’t use an input field here. It’s confusing to present something as an input when it’s strictly read-only, since it naturally implies it’s editable. My initial instinct is always to try typing into it.

I assume the main reason an input was used is to make it easy to copy the last successfully executed query. If that’s the case, I think this should be redesigned to clearly indicate that it’s just a read-only display of the query. A copy icon would handle the copying use case more explicitly.
Image

It might be worth looking at how ChatGPT or Claude present code snippets, since they handle this kind of “read-only but copyable” content in a very clear way.

If you like you can also address this issue in a later PR.

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.

Will do this in a seperate PR

@ivy-tgr ivy-tgr force-pushed the XIVY-18080-SQL-Editor branch from aaad906 to 4a7efd2 Compare June 25, 2026 12:56

@ivy-edp ivy-edp left a comment

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.

Cool, looks good to me 👍 try using Tailwind instead of inline styles and consider using useFunction in the other places where functions are being used as well. Other than that, it's good to go from my side 👍

@ivy-tgr ivy-tgr force-pushed the XIVY-18080-SQL-Editor branch from 4a7efd2 to 0834ed6 Compare June 25, 2026 13:14
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.

2 participants