CREATE ROLE

Syntax

CREATE ROLE role_name [PRIVILEGE privilege_name [DATABASE database_name] [TABLE table_name]]

Privileges

USERADMIN

Description

Roles grant users access to SQLite Cloud resources (a database, a table, or global). SQLite Cloud provides several built-in roles administrators can use to control access to an SQLite Cloud system. However, if these roles cannot describe the desired set of privileges, you can create new roles in a particular database/table. The optional PRIVILEGE parameter specifies which privileges (in comma-separated format) must be associated with the ROLE. A privilege can later be associated with a ROLE using the GRANT PRIVILEGE command. The DATABASE and TABLE optional arguments can restrict the particular PRIVILEGES to a specific resource (otherwise, the ROLE is considered global). If PRIVILEGES is omitted then DATABASE and TABLE parameters are ignored.

Return

OK string or error value (see SCSP protocol).

Example

> CREATE ROLE sample_role PRIVILEGE CLUSTERADMIN,CLUSTERMONITOR,READWRITE
OK