Skip to content

Conversation

koszti
Copy link
Member

@koszti koszti commented Sep 25, 2025

Description

This PR introduces the initial version of the trino <QueryEditor> reusable react component primarily to enable the publishing workflow as an npm package. Once merged the GHA release workflow should publish the first version of the package to npm.

IMPORTANT: NPM_TOKEN github secret must be set in this github repo!

The component is already a functional Trino web query runner. However, it currently lacks configurable parameters, styling, and requires several further major refinements. These improvements will be addressed separately and incrementally after confirming that the npm publishing process works as expected. This initial version (0.0.1) is not yet recommended for production workloads. Production-ready builds and documentation will follow soon.

Example usage:

npm install trino-query-ui

it can be used in any react project (such as the main trino or the trino-gateway UI):

import { QueryEditor } from 'trino-query-ui'
import 'trino-query-ui/dist/index.css'

function MyTrinoApp() {
  return <QueryEditor />
}

export default MyTrinoApp

Additional context and related issues

  • No existing functionality has been changed.
  • All dependencies updated to latest versions and all breaking changes addressed caused by major updates
  • Further major refactoring will be required before it’s fully production-ready.

@cla-bot cla-bot bot added the cla-signed label Sep 25, 2025
@koszti koszti force-pushed the make-reusable-react-component branch 2 times, most recently from b102d69 to 1e23033 Compare September 25, 2025 20:11
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

First review round done .. I have to test it some more and see what you think about my input .. beyond that I think we should merge it soon so we can see if it works and then follow up with more refinements after a first release

release:
types: [created]
pull_request:
types: [published]
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@koszti koszti Oct 12, 2025

Choose a reason for hiding this comment

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

This shouldn’t make a difference but according to the docs the published event seemed more accurate than created. I’ve updated the PR though to use created so the gh workflows are now consistent across both projects.


Docs:
types: [created] → fires when a release object is first created (often as a draft). But GitHub does not trigger workflows for created (or edited/deleted) if the release is a draft created via the UI.
GitHub Docs

types: [published] → fires when a release (or pre-release) is published (made visible). This is the most common choice for CI/CD on new releases."_

README.md Outdated
# Trino Query UI

This Trino Query UI is a new UI component that can be integrated into Trino and run directly from the Trino installation at the `/query/` path. For testing, it can also be run separately and can proxy to a Trino running locally or elsewhere.
A reusable React component for executing queries against Trino. It can be embedded into any react application and configured to proxy requests to a local or remote Trino cluster.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A reusable React component for executing queries against Trino. It can be embedded into any react application and configured to proxy requests to a local or remote Trino cluster.
A reusable React component for executing queries against Trino. It can be embedded into any React application and configured to proxy requests to a local or remote Trino cluster.

also please wrap at 80 column width here and other paragraphs

README.md Outdated
A reusable React component for executing queries against Trino. It can be embedded into any react application and configured to proxy requests to a local or remote Trino cluster.

> [!WARNING]
> This package is under heavy development and is not yet recommended for production workloads. Treat the current release as an early-stage demo; production-ready builds and documentation will follow soon.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> This package is under heavy development and is not yet recommended for production workloads. Treat the current release as an early-stage demo; production-ready builds and documentation will follow soon.
> This package is under heavy development and is not yet recommended for production workloads. Treat the current release as an early-stage demo; production-ready builds and documentation are planned.

```
cd precise
npm run build
npm install trino-query-ui
Copy link
Member

Choose a reason for hiding this comment

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

That will only work after we cut a release .. but lets assume we succeed

README.md Outdated
return false;
}
}
## Quick Start
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## Quick Start
## Quick start

README.md Outdated

The local URL will be be displayed which you can open in your browser.

### Building the Parser
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### Building the Parser
### Building the parser

README.md Outdated
Run `npm run antlr4ng` to build the parser, as configured in **package.json**.

### Linting and code formatting
### Linting and Code Formatting
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### Linting and Code Formatting
### Linting and code formatting

README.md Outdated
- Show stages and split counts like the Trino console client
4. Keep the experience easy to navigate

### Gaps and Future Direction
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
### Gaps and Future Direction
### Gaps and future direction

"type": "git",
"url": "https://github.com/trinodb/trino-query-ui.git"
},
"homepage": "https://trinodb.github.io/trino-query-ui",
Copy link
Member

Choose a reason for hiding this comment

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

We dont have that set up at this stage so lets use the same URL as for the source

"precise": "file:",
"prettier": "^3.5.3",
"react": "^18.2.0",
"@monaco-editor/react": "^4.7.0",
Copy link
Member

Choose a reason for hiding this comment

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

Should we really upgrade all the deps in this PR as well.. maybe at least in a separate commit or add more info in a longer commit message

Copy link
Member Author

@koszti koszti Oct 12, 2025

Choose a reason for hiding this comment

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

I moved the dependency updates to a separate commit but left it in the same PR. I hope that's fine

@mosabua
Copy link
Member

mosabua commented Oct 12, 2025

Also note the npm token should be available as it set organization-wide now ..

@koszti koszti force-pushed the make-reusable-react-component branch 2 times, most recently from ae8c126 to 5b34232 Compare October 12, 2025 15:46
@koszti koszti force-pushed the make-reusable-react-component branch from 5b34232 to d032be6 Compare October 12, 2025 15:53
@koszti
Copy link
Member Author

koszti commented Oct 12, 2025

@mosabua thanks I addressed all comments. let me know if I missed something

@koszti koszti requested a review from mosabua October 12, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants