Skip to content

Commit 369d437

Browse files
committed
feat(dwh): update db and users mgmt pages for beta MTA-6431
1 parent cdf7714 commit 369d437

File tree

2 files changed

+136
-19
lines changed

2 files changed

+136
-19
lines changed

pages/data-warehouse/how-to/manage-databases.mdx

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ dates:
99
import Requirements from '@macros/iam/requirements.mdx'
1010

1111

12-
This page explains how to manage databases in your Data Warehouse for ClickHouse® deployment using the [Scaleway console](https://console.scaleway.com/).
13-
14-
<Message type="note">
15-
During the private beta phase, database management can only be done with the **scwadmin** & via the ClickHouse® CLI, MySQL or HTTPS protocols.
16-
</Message>
12+
This page explains how to manage databases in your Data Warehouse for ClickHouse® deployment.
1713

1814
<Requirements />
1915

@@ -24,14 +20,47 @@ During the private beta phase, database management can only be done with the **s
2420

2521
## How to manage databases using the Scaleway console
2622

27-
During the private beta phase, the management of databases in your Data Warehouse for ClickHouse® deployment is limited to viewing databases in your deployment.
23+
The Scaleway console allows you to create and delete databases for your Data Warehouse for ClickHouse® deployment.
24+
25+
### How to create a database using the Scaleway console
26+
27+
1. Click **ClickHouse®** under **Data & Analytics** on the side menu. The Data Warehouse deployment page displays.
28+
29+
2. Click the name of the desired Data Warehouse deployment. The **Overview** tab of the deployment displays.
30+
31+
3. Click the **Databases** tab. A list of your current databases displays.
32+
33+
4. Click **+ Create database**. A popup displays.
34+
35+
5. Enter a name for your new database. It can can only contain alphanumeric characters, underscores, and dashes.
36+
37+
6. Click **Create database** to confirm.
38+
39+
Your new database appears in the list.
40+
41+
### How to delete a database using the Scaleway console
42+
43+
<Message type="note">
44+
The `default` database cannot be deleted.
45+
</Message>
46+
47+
1. Click **ClickHouse®** under **Data & Analytics** on the side menu. The Data Warehouse deployment page displays.
48+
49+
2. Click the name of the desired Data Warehouse deployment. The **Overview** tab of the deployment displays.
50+
51+
3. Click <Icon name="delete" /> next to the name of the database you want to delete. A confirmation popup displays.
52+
53+
4. Enter `DELETE`, then click **Delete database** to confirm.
54+
55+
The deleted database no longer appears in the list.
2856

2957
## How to manage databases using frameworks
3058

31-
[Connect to your deployment](/data-warehouse/how-to/connect-applications/) using your preferred framework.
32-
<Message type="tip">
33-
You can also connect using the ClickHouse HTTP console from the **Overview** tab of your deployment. Make sure to enter valid credentials in the top-right fields.
34-
</Message>
59+
[Connect to your deployment](/data-warehouse/how-to/connect-applications/) using your preferred framework.
60+
61+
<Message type="tip">
62+
You can also connect using the ClickHouse HTTP console from the **Overview** tab of your deployment. Make sure to enter valid credentials in the top-right fields.
63+
</Message>
3564

3665
Once connected, you can run SQL queries to `CREATE/ALTER/DROP` your `DATABASE/TABLE`.
3766

pages/data-warehouse/how-to/manage-users.mdx

Lines changed: 97 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ dates:
99
import Requirements from '@macros/iam/requirements.mdx'
1010

1111

12-
This page explains how to manage users in your Data Warehouse for ClickHouse® deployment using the [Scaleway console](https://console.scaleway.com/).
13-
14-
<Message type="note">
15-
During the private beta phase, user management can only be done with the **scwadmin** user via the ClickHouse® CLI, MySQL or HTTPS protocols.
16-
</Message>
12+
This page explains how to manage users in your Data Warehouse for ClickHouse® deployment.
1713

1814
<Requirements />
1915

@@ -24,9 +20,53 @@ During the private beta phase, user management can only be done with the **scwad
2420

2521
## How to manage users using the Scaleway console
2622

27-
During the private beta phase, the management of users for your Data Warehouse for ClickHouse® deployment is limited to:
28-
- Viewing users in your deployment
29-
- Changing the password of an existing user
23+
The Scaleway console allows you to create users for your Data Warehouse for ClickHouse® deployment, to grant them admin rights, to update their password, and to delete them.
24+
25+
### How to create a user using the Scaleway console
26+
27+
1. Click **ClickHouse®** under **Data & Analytics** on the side menu. The Data Warehouse deployment page displays.
28+
29+
2. Click the name of the desired Data Warehouse deployment. The **Overview** tab of the deployment displays.
30+
31+
3. Click the **Users** tab. A list of your current users displays.
32+
33+
4. Click **+ Create user**. A popup displays.
34+
35+
5. Enter a username. It must be unique can contain up to 63 characters, and must start with a letter. Only alphanumeric characters, underscores, and dashes are accepted.
36+
37+
6. Enter a password, or generate one automatically.
38+
39+
7. Enable the toggle if you want to grant admin rights to the user.
40+
41+
8. Click **Create user** to proceed.
42+
43+
The newly created user appears in the list of your deployment's users.
44+
45+
### How to update a user's password and admin rights
46+
47+
1. Click **ClickHouse®** under **Data & Analytics** on the side menu. The Data Warehouse deployment page displays.
48+
49+
2. Click the name of the desired Data Warehouse deployment. The **Overview** tab of the deployment displays.
50+
51+
3. Click the **Users** tab. A list of your current users displays.
52+
53+
4. Click <Icon name="more" /> next to the name of the user you want to update, then click ¨**Update user**. A popup displays.
54+
55+
5. Update the user's password and/or admin rights, then click **Update user** to confirm.
56+
57+
### How to delete a user using the Scaleway console
58+
59+
1. Click **ClickHouse®** under **Data & Analytics** on the side menu. The Data Warehouse deployment page displays.
60+
61+
2. Click the name of the desired Data Warehouse deployment. The **Overview** tab of the deployment displays.
62+
63+
3. Click the **Users** tab. A list of your current users displays.
64+
65+
4. Click <Icon name="delete" /> next to the name of the user you want to delete. A confirmation popup displays.
66+
67+
5. Enter `DELETE`, then click **Delete user** to confirm.``
68+
69+
The user is deleted and no longer appears in the list.
3070

3171
## How to manage users using frameworks
3272

@@ -37,4 +77,52 @@ During the private beta phase, the management of users for your Data Warehouse f
3777

3878
Once connected, you can run SQL queries using `USER`, `ROLE`, and `ROW POLICY` to create new users and grant them the desired permissions via roles.
3979

40-
Refer to the official ClickHouse® documentation on [users and roles](https://clickhouse.com/docs/sql-reference/statements/create/user) for more information.
80+
Refer to the official ClickHouse® documentation on [users and roles](https://clickhouse.com/docs/sql-reference/statements/create/user) for more information.
81+
82+
## Manage user permissions
83+
84+
[Connect to your deployment](/data-warehouse/how-to/connect-applications/) using your preferred framework.
85+
86+
Once connected, you can run SQL as shown below to grant the desired permissions to users.
87+
88+
**Grant permission to create databases**
89+
90+
```sql
91+
GRANT CREATE DATABASE ON . TO user;
92+
```
93+
94+
**Grant permission to create tables in any database**
95+
96+
```sql
97+
GRANT CREATE TABLE ON . TO user;
98+
```
99+
100+
**Grant permission to create tables in a specific database**
101+
102+
```sql
103+
GRANT CREATE TABLE ON database_name.* TO user;
104+
```
105+
106+
**Grant data manipulation permissions for any table in any database**
107+
108+
```sql
109+
GRANT INSERT, UPDATE, DELETE ON . TO user;
110+
```
111+
112+
**Grant data manipulation permissions for any table in a specific database**
113+
114+
```sql
115+
GRANT INSERT, UPDATE, DELETE ON database_name.* TO user;
116+
```
117+
118+
**Grant data manipulation permissions for a specific table in a specific database**
119+
120+
```sql
121+
GRANT INSERT, UPDATE, DELETE ON database_name.table_name TO user;
122+
```
123+
124+
**Grant every permissions on every database**
125+
126+
```sql
127+
GRANT CREATE DATABASE, CREATE TABLE, INSERT, UPDATE, DELETE ON . TO user;
128+
```

0 commit comments

Comments
 (0)