Skip to content

Commit f4ca329

Browse files
authored
Merge branch 'main' into feature_cluster
2 parents 515ee1b + c2f561d commit f4ca329

File tree

32 files changed

+1102
-368
lines changed

32 files changed

+1102
-368
lines changed

.github/actions/create_check_status/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ runs:
4545
with:
4646
github-token: ${{ inputs.github_token }}
4747
script: |
48-
let summary = `${process.env.param_summary}
48+
let summary = `
49+
${process.env.param_summary}
4950
[View Details](https://github.com/datafuselabs/databend/actions/runs/${context.runId})`;
5051
let data = {
5152
owner: context.repo.owner,

.github/workflows/trusted-benchmark.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323

2424
jobs:
2525
metadata:
26-
if: github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_call'
26+
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
2727
runs-on: [self-hosted, X64, Linux, dev]
2828
outputs:
2929
sha: ${{ steps.metadata.outputs.sha }}
@@ -48,17 +48,13 @@ jobs:
4848
echo "source=pr" >> $GITHUB_OUTPUT
4949
echo "source_id=$(jq -r '.pr_id' metadata.json)" >> $GITHUB_OUTPUT
5050
;;
51-
workflow_call)
51+
*)
5252
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
5353
echo "head_sha=${{ github.sha }}" >> $GITHUB_OUTPUT
5454
echo "run_id=${{ github.run_id }}" >> $GITHUB_OUTPUT
5555
echo "source=release" >> $GITHUB_OUTPUT
5656
echo "source_id=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
5757
;;
58-
*)
59-
echo "Unknown event name: ${{ github.event_name }}"
60-
exit 1
61-
;;
6258
esac
6359
- uses: ./.github/actions/create_check_status
6460
if: steps.metadata.outputs.source == 'pr'
@@ -160,7 +156,7 @@ jobs:
160156
databend-query --version
161157
databend-meta --version
162158
- name: Set github check status to pending
163-
if: steps.metadata.outputs.source == 'pr'
159+
if: needs.metadata.outputs.source == 'pr'
164160
uses: ./.github/actions/create_check_status
165161
with:
166162
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -179,7 +175,7 @@ jobs:
179175
source: ${{ needs.metadata.outputs.source }}
180176
source_id: ${{ needs.metadata.outputs.source_id }}
181177
- name: Set github check status to completed
182-
if: steps.metadata.outputs.source == 'pr'
178+
if: needs.metadata.outputs.source == 'pr'
183179
uses: ./.github/actions/create_check_status
184180
with:
185181
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -261,7 +257,7 @@ jobs:
261257
- uses: actions/checkout@v3
262258
- uses: ./.github/actions/setup_bendsql
263259
- name: Set github check status to pending
264-
if: steps.metadata.outputs.source == 'pr'
260+
if: needs.metadata.outputs.source == 'pr'
265261
uses: ./.github/actions/create_check_status
266262
with:
267263
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -286,7 +282,7 @@ jobs:
286282
cloud_org: ${{ secrets.BENCHMARK_CLOUD_ORG }}
287283
cloud_endpoint: ${{ secrets.BENCHMARK_CLOUD_ENDPOINT }}
288284
- name: Set github check status to pending
289-
if: steps.metadata.outputs.source == 'pr'
285+
if: needs.metadata.outputs.source == 'pr'
290286
uses: ./.github/actions/create_check_status
291287
with:
292288
github_token: ${{ secrets.GITHUB_TOKEN }}

benchmark/clickbench/benchmark_cloud.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function run_query() {
9595
fi
9696
}
9797

98-
TRIES=6
98+
TRIES=5
9999
QUERY_NUM=1
100100
while read -r query; do
101101
echo "Running Q${QUERY_NUM}: ${query}"

docs/doc/01-guides/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ These tutorials are intended to help you get started with Databend:
1818
* [How to Connect Databend with MySQL Client](../11-integrations/00-api/01-mysql-handler.md)
1919
* [How to Connect Databend with ClickHouse HTTP Handler](../11-integrations/00-api/02-clickhouse-handler.md)
2020
* [How to Connect Databend with REST API](../11-integrations/00-api/00-rest.md)
21-
* [How to Connect Databend with DBeaver SQL IDE](../11-integrations/20-gui-tool/01-dbeaver.md)
21+
* [How to Connect Databend with MySQL-Compatible Clients](../11-integrations/30-access-tool/00-mysql.md)
22+
* [How to Connect Databend with bendsql](../11-integrations/30-access-tool/01-bendsql.md)
2223
* [How to Execute Queries in Python](../03-develop/01-python.md)
2324
* [How to Query Databend in Jupyter Notebooks](../11-integrations/20-gui-tool/00-jupyter.md)
2425
* [How to Execute Queries in Golang](../03-develop/00-golang.md)

docs/doc/11-integrations/20-gui-tool/01-dbeaver.md

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: MySQL-Compatible Clients
3+
sidebar_label: MySQL-Compatible Clients
4+
description:
5+
Connect Databend from MySQL-compatible clients.
6+
---
7+
8+
Databend provides support for MySQL compatible CLI and GUI clients where you can connect to Databend and execute queries from.
9+
10+
:::note
11+
Databend is not a complete implementation of the MySQL protocol, so certain programs such as some ORM frameworks may not be able to connect to Databend.
12+
:::
13+
14+
To connect to Databend with MySQL compatible clients, you will need to connect to port 3307 with a SQL user created in Databend.
15+
16+
This example connects to a remote Databend with a SQL user named `databend`:
17+
18+
```shell
19+
mysql -h172.20.0.2 -udatabend -P3307 -pdatabend
20+
```
21+
22+
This example connects to a local Databend with the user `root`:
23+
24+
```shell
25+
mysql -h127.0.0.1 -uroot -P3307
26+
```
27+
28+
## Built-in Accounts
29+
30+
There are four built-in accounts in Databend that can be accessed from a local machine without requiring a password. These accounts are immutable and possess the highest level of privileges, meaning their settings cannot be altered or removed. Additionally, it is not possible to change or update their passwords.
31+
32+
33+
- `root@localhost`
34+
35+
- `default@localhost`
36+
37+
## Example: Connect from DBeaver
38+
39+
DBeaver is a universal database management tool for everyone who needs to work with data in a professional way. With DBeaver you are able to manipulate with your data like in a regular spreadsheet, create analytical reports based on records from different data storages, export information in an appropriate format.
40+
41+
The following steps show how to establish a connection to Databend with DBeaver.
42+
43+
1. Create a SQL user in Databend.
44+
45+
```sql
46+
CREATE USER user1 IDENTIFIED BY 'abc123';
47+
GRANT ALL ON *.* TO user1;
48+
```
49+
50+
2. In DBeaver, choose a driver for the new connection. Select `MySQL`, then click **Next**.
51+
52+
<p align="center">
53+
<img src="https://datafuse-1253727613.cos.ap-hongkong.myqcloud.com/integration/ingegration-dbeaver-connection-1.png" width="500"/>
54+
</p>
55+
56+
3. On the **Connection Settings** screen, configure your connection settings, including:
57+
* Host
58+
* Port
59+
* Database name
60+
* Username and password
61+
62+
<p align="center">
63+
<img src="https://datafuse-1253727613.cos.ap-hongkong.myqcloud.com/integration/ingegration-dbeaver-connection-2.png" width="500"/>
64+
</p>
65+
66+
4. Click **Test Connection...** to see if the connection works.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: bendsql
3+
sidebar_label: bendsql
4+
description:
5+
Databend-native CLI
6+
---
7+
8+
[bendsql](https://github.com/databendcloud/bendsql) is a command line tool that has been designed specifically for Databend. It allows users to establish a connection with Databend and execute queries directly from a CLI window.
9+
10+
This tool is particularly useful for those who prefer a command line interface and need to work with Databend on a regular basis. With bendsql, users can easily and efficiently manage their databases, tables, and data, and perform a wide range of queries and operations with ease.
11+
12+
## Downloading and Installing bendsql
13+
14+
To download and install bendsql, please go to the [bendsql](https://github.com/databendcloud/bendsql) repository on GitHub and follow the README instructions.
15+
16+
## Connecting to Databend
17+
18+
Use `bendsql connect` to connect to a Databend instance:
19+
20+
```shell
21+
eric@ericdeMacBook rsdoc % bendsql connect -h
22+
Connect to Databend Instance
23+
24+
USAGE
25+
bendsql connect [flags]
26+
27+
FLAGS
28+
-d, --database string (default "default")
29+
-H, --host string (default "localhost")
30+
-p, --password string
31+
-P, --port int (default 8000)
32+
--ssl
33+
-u, --user string (default "root")
34+
35+
INHERITED FLAGS
36+
--help Show help for command
37+
38+
LEARN MORE
39+
Use 'bendsql <command> <subcommand> --help' for more information about a command.
40+
```
41+
42+
To connect to a local Databend, simply run `bendsql connect`:
43+
44+
```shell
45+
eric@ericdeMacBook rsdoc % bendsql connect
46+
Connected to Databend on Host: localhost
47+
Version: DatabendQuery v0.9.58-nightly-790be61(rust-1.68.0-nightly-2023-03-01T16:41:18.376657Z)
48+
```
49+
## Running Queries with bendsql
50+
51+
After connecting bendsql to your Databend instance, you can use `bendsql query` to run queries with the tool:
52+
53+
```shell
54+
eric@ericdeMacBook rsdoc % bendsql query
55+
Connected with driver databend (DatabendQuery v0.9.58-nightly-790be61(rust-1.68.0-nightly-2023-03-01T16:41:18.376657Z))
56+
Type "help" for help.
57+
58+
dd:root@localhost/default=> SELECT NOW();
59+
+------------------------+
60+
| now() |
61+
+------------------------+
62+
| 2023-03-02T21:47:10.4Z |
63+
+------------------------+
64+
(1 row)
65+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Clients",
3+
"link": {
4+
"type": "generated-index",
5+
"slug": "/integrations/clients"
6+
}
7+
}

0 commit comments

Comments
 (0)