WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit fd86431

Browse files
committed
Improve documentation
1 parent f61e5f4 commit fd86431

File tree

2 files changed

+62
-19
lines changed

2 files changed

+62
-19
lines changed

README.md

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Trino Query UI
22

3-
A reusable React component for executing queries against Trino. It can be
4-
embedded into any React application and configured to proxy requests to a local
5-
or remote Trino cluster.
3+
A reusable React component as a query interface for the SQL query engine
4+
[Trino](https://trino.io/). Browse connected catalogs, write SQL queries,
5+
execute the queries and inspect result data all in a web application connected
6+
to your Trino cluster.
7+
8+
The component can be embedded into any React application and configured to proxy
9+
requests to a local or remote Trino cluster.
610

711
> [!WARNING]
812
> This package is under heavy development and is not yet recommended for
@@ -12,13 +16,31 @@ or remote Trino cluster.
1216
![Trino Query UI](screenshot.png "Trino Query UI")
1317

1418
Implementation details:
19+
1520
* React TypeScript project with Vite
1621
* Uses Node.js v20+
1722
* Monaco editor + ANTLR parser using the Trino language
1823

24+
## Features
25+
26+
* Browse metadata about catalogs, schemas, tables, and more
27+
* Search across catalogs
28+
* Set queries session context.
29+
* Inspect data with generated queries
30+
* Preview sample data
31+
* Write queries manually with schema-aware SQL syntax completion and
32+
highlighting
33+
* Use multiple query tabs
34+
* View schema information in SQL queries via mouse-over hovering
35+
* Format SQL queries in the editor
36+
* Copy result set table data to the clipboard
37+
* Monitor query processing across the Trino cluster
38+
39+
See details in the [demo animation](./demos.gif).
40+
1941
## Installation
2042

21-
```
43+
```shell
2244
npm install trino-query-ui
2345
```
2446

@@ -38,20 +60,22 @@ export default MyTrinoApp
3860
## Building and shipping in Trino
3961

4062
The Query UI builds just like the existing UI in Trino.
41-
1. First you build the TypeScript into Javascript and CSS
42-
2. Then copy the distributable path into Trino.
43-
3. Then modify Trino to respond to the query ui path.
63+
64+
1. Build the TypeScript into Javascript and CSS
65+
2. Copy the distributable path into Trino.
66+
3. Modify Trino to respond to the query ui path.
4467

4568
### Building for integration
4669

47-
```
70+
```shell
4871
cd precise
72+
npm install
4973
npm run build
5074
```
5175

5276
### Copying into Trino
5377

54-
```
78+
```shell
5579
mkdir -p $TRINO_HOME/core/trino-main/src/main/resources/query_ui_webapp/
5680
cp -r dist/* $TRINO_HOME/core/trino-main/src/main/resources/query_ui_webapp/
5781
```
@@ -119,8 +143,10 @@ Add `/query/` path. Note any path can be used:
119143
### Build and run
120144

121145
1. Install Node.js (v20 or newer) from <https://nodejs.org/en/download/>
122-
2. Install the dependencies and run the dev server:
123-
```
146+
2. Ensure Trino is running at the configured URL. Defaults to http://localhost:8080
147+
3. Install the dependencies and run the dev server:
148+
149+
```shell
124150
cd precise
125151
npm install
126152
npm run dev
@@ -130,9 +156,9 @@ The local URL is displayed, and you can open it in your browser.
130156

131157
### Set up proxying to a local Trino instance
132158

133-
Update `vite.config.ts` with the following so that queries can be
134-
proxied to Trino's query endpoint running on `http://localhost:8080` (or any
135-
other path you require).
159+
By default `vite.config.ts` is configured so that queries can be proxied to
160+
Trino's query endpoint running on `http://localhost:8080`. Modify the setting to
161+
suit your needs with another URL and updated configuration:
136162

137163
```tsx
138164
import { defineConfig } from 'vite'
@@ -157,23 +183,27 @@ export default defineConfig({
157183

158184
### Building the parser
159185

160-
Run `npm run antlr4ng` to build the parser, as configured in **package.json**.
186+
Build the parser, as configured in **package.json**.
187+
188+
```shell
189+
npm run antlr4ng
190+
```
161191

162192
### Linting and code formatting
163193

164-
To check code quality and formatting:
194+
To check code quality and formatting with ESLint and Prettier, as defined in
195+
**package.json**:
165196

166197
```shell
167-
npm run check
198+
npm run check
168199
```
169200

170-
This command runs both ESLint and Prettier, as defined in **package.json**.
171-
172201
## Philosophy
173202

174203
This UI's purpose is to provide an environment where, once the cluster is up,
175204
you can immediately execute queries and explore data sets. The intended use
176205
cases are:
206+
177207
* Initial proof-of-concept queries.
178208
* Exploration of data sets.
179209
* Performance analysis.
@@ -183,6 +213,7 @@ cases are:
183213
* Early demos.
184214

185215
The approach:
216+
186217
1. Direct integration into the Trino UI
187218
- No need for an additional authentication hop (although it could be added
188219
in the future)

precise/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Trino Query UI
2+
3+
A reusable React component as a query interface for the SQL query engine
4+
[Trino](https://trino.io/). Browse connected catalogs, write SQL queries,
5+
execute the queries and inspect result data all in a web application connected
6+
to your Trino cluster.
7+
8+
The component can be embedded into any React application and configured to proxy
9+
requests to a local or remote Trino cluster.
10+
11+
Find more details including using the component, screenshots, development and
12+
more in our [source code repository](https://github.com/simpligility/trino-query-ui).

0 commit comments

Comments
 (0)