165 lines
6.6 KiB
Markdown
165 lines
6.6 KiB
Markdown
- [SQLFlow frontend guide](#sqlflow-frontend-guide)
|
||
* [video](#video)
|
||
+ [1. editor](#1-editor)
|
||
- [1.1 dbvendor](#11-dbvendor)
|
||
- [1.2 sample sql](#12-sample-sql)
|
||
- [1.3 upload](#13-upload)
|
||
- [1.4 visualize](#14-visualize)
|
||
- [1.5 visualize join](#15-visualize-join)
|
||
- [1.6 login](#16-login)
|
||
+ [2. schema](#2-schema)
|
||
- [seach schema](#seach-schema)
|
||
- [seach schema path](#seach-schema-path)
|
||
- [collapse all](#collapse-all)
|
||
+ [3. setting](#3-setting)
|
||
+ [4. job](#4-job)
|
||
+ [5. download](#5-download)
|
||
+ [6. sqlflow diagram panel](#6-sqlflow-diagram-panel)
|
||
+ [How it works](#how-it-works)
|
||
+ [Restful API](#restful-api)
|
||
|
||
|
||
|
||
# SQLFlow frontend guide
|
||
|
||

|
||
|
||
## video
|
||
- [SQLFlow get started](images/sqlflow_tutorial_101.gif)
|
||
- [SQLFlow visual diagram](images/sqlflow_tutorial_diagram.gif)
|
||
- [SQLFlow settings](images/sqlflow_tutorial_settings.gif)
|
||
- [SQLFlow search and visualize](images/sqlflow-tutorial-search-table-visualize.gif)
|
||
|
||
### 1. editor
|
||
|
||
Enter the sql into the input box, and then choose the database accordingly from the dbvendor menu,
|
||
then click visualize or visualize join button to get a clear nice data lineage diagram.
|
||
|
||
|
||
#### 1.1 dbvendor
|
||
Select the corresponding database.
|
||
|
||
#### 1.2 sample sql
|
||
|
||
Click sample sql button will load the sample SQL for the current selected database
|
||
to the input box.
|
||
|
||
#### 1.3 upload
|
||
|
||
upload a single SQL file, or a zip file includes multiple SQL files for processing.
|
||
A job will be created for the uploaded file.
|
||
|
||
#### 1.4 visualize
|
||
|
||
click visualize button will call [graph interface](#graph), and pass the following parameters:
|
||
API used when click the button.
|
||
|
||
| name | value |
|
||
| ---------------- | ----------------------------------------- |
|
||
| sqltext | SQL query in the input box |
|
||
| dbvendor | database from the dbvendor menu |
|
||
| showRelationType | fdd |
|
||
| ignoreFunction | true |
|
||
|
||
#### 1.5 visualize join
|
||
|
||
click visualize join button will call [graph interface](#graph), and pass the following parameters:
|
||
API used when click the visualize join button.
|
||
|
||
| name | value |
|
||
| ---------------- | ----------------------------------------- |
|
||
| sqltext | SQL query in the input box |
|
||
| dbvendor | database from the dbvendor menu |
|
||
| showRelationType | join |
|
||
| ignoreFunction | true |
|
||
|
||
#### 1.6 login
|
||
|
||
You have to login in order to upload a SQL or zip file for processing.
|
||
|
||
### 2. schema
|
||
|
||
show the schema objects returned by the backend.
|
||
you can select a schema/database/table and click the right mouse button to visualize the data lineage of the selected schema object.
|
||
|
||

|
||
|
||
|
||
- global, green color, means all data lineage information is returned for this object.
|
||
- summary, black color, means summary information returned for this object.
|
||
- ignore record, orange color, means data lineage is returned without intermediate result.
|
||
|
||

|
||
|
||
the color of `DATAMART、DBO` is orange, means the returned data linege doesn't include the intermediate result.
|
||
the color of `LOAN` is greeen, means all data lineage informaiton is returned.
|
||
node in gray means it's not visualized yet.
|
||
|
||
#### seach schema
|
||
|
||
your can search `database`,`schema`,`table`,`schema` in the schema tree.
|
||
|
||

|
||
|
||
#### seach schema path
|
||
|
||
you can search `database.schema.table.column ` ,`schema.table`,`table.column` or someting else like it. When you type `dot`, the schema tree will expand the next level.
|
||
|
||

|
||
|
||
#### collapse all
|
||
|
||

|
||
|
||
### 3. setting
|
||
|
||

|
||
|
||
set the [graph interface](#graph):
|
||
|
||
| name | value |
|
||
| ---------------- | ------------------------------------------------------------ |
|
||
| hideColumn | false/true,hide all columns |
|
||
| showRelationType | dataflow=true, impact=false, then value is fdd.<br /> dataflow=true, impact=true, the value is fdd,ddi,fdr,frd;<br /> if dataflow=false, impact=true, the value is: fddi,fdr,frd; |
|
||
| ignoreRecordSet | false/true,show intermediate recordset |
|
||
| ignoreFunction | false/true,show function |
|
||
|
||
### 4. job
|
||
|
||

|
||
|
||
click upload button to create a job by submit SQL text file or zip file including multiple SQL files or connect to a database.
|
||
|
||
### 5. download
|
||
|
||
export result to json or png file for download.
|
||
|
||
### 6. sqlflow diagram panel
|
||
|
||
select a column to highlight the data flow, click cancel button to cancel the highlight.
|
||
|
||

|
||
|
||
right mouse click the menu item table lineage or column lineage to show the table or column relation, click cancel to back to the previous state.
|
||
|
||

|
||
|
||
### How it works
|
||
|
||
SQLFlow frontend communicates with the backend using the RESTFul API [**/sqlflow/generation/sqlflow/graph**](https://github.com/sqlparser/sqlflow_public/blob/master/api/sqlflow_api.md)。
|
||
Once it fetchs data from the backend, the frontend will analyze the graph and sqlflow and draw an interactive diagram accordingly.
|
||
|
||
Click the button or change the value in the setting panel will result in calling different API or call the same API with the different parameters,
|
||
and get the different data from the backend consequence.
|
||
|
||
|
||
Reference:[SQLFlow api doc](https://github.com/sqlparser/sqlflow_public/blob/master/api/sqlflow_api.md)
|
||
|
||
|
||
### Restful API
|
||
|
||
Reference:[SQLFlow api doc](https://github.com/sqlparser/sqlflow_public/blob/master/api/sqlflow_api.md)
|
||
|
||
<span id="graph">graph interfact:</span> post /sqlflow/generation/sqlflow/graph
|
||
|