Skip to content

Commit 1859426

Browse files
authored
chore: add user option workload group set doc (#2263)
1 parent f2c824e commit 1859426

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/en/sql-reference/10-sql-commands/00-ddl/02-user/01-user-create-user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CREATE [ OR REPLACE ] USER <name> IDENTIFIED [ WITH <auth_type> ] BY '<password>
2121
[ WITH MUST_CHANGE_PASSWORD = true | false ]
2222
[ WITH SET PASSWORD POLICY = '<policy_name>' ] -- Set password policy
2323
[ WITH SET NETWORK POLICY = '<policy_name>' ] -- Set network policy
24+
[ WITH SET WORKLOAD GROUP = '<workload_group_name>' ] -- Set workload group
2425
[ WITH DEFAULT_ROLE = '<role_name>' ] -- Set default role
2526
[ WITH DISABLED = true | false ] -- User created in a disabled state
2627
```

docs/en/sql-reference/10-sql-commands/00-ddl/02-user/03-user-alter-user.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ ALTER USER <name> WITH DEFAULT_ROLE = '<role_name>'
4242

4343
-- Enable or disable user
4444
ALTER USER <name> WITH DISABLED = true | false
45+
46+
-- Set workload group
47+
ALTER USER <name> WITH SET WORKLOAD GROUP = '<workload_group_name>'
48+
49+
-- Unset workload group
50+
ALTER USER <name> WITH UNSET WORKLOAD GROUP
4551
```
4652

4753
- *auth_type* can be `double_sha1_password` (default), `sha256_password` or `no_password`.
@@ -154,4 +160,16 @@ SHOW roles
154160
│ writer │ 0 │ true │ true │
155161
└───────────────────────────────────────────────────────┘
156162
3 rows read in 0.010 sec. Processed 0 rows, 0 B (0 rows/s, 0 B/s)
163+
```
164+
165+
### Example 2: Setting & Unsetting Workload Group
166+
167+
```sql
168+
CREATE USER user1 IDENTIFIED BY 'abc123';
169+
170+
ALTER USER user1 WITH SET WORKLOAD GROUP='wg';
171+
172+
ALTER USER user1 WITH SET WORKLOAD GROUP='wg1';
173+
174+
ALTER USER user1 WITH UNSET WORKLOAD GROUP;
157175
```

0 commit comments

Comments
 (0)