| title | Privilege Commands |
|---|---|
| description | Use these commands to manage privileges in SQLite Cloud. |
| category | reference |
| status | publish |
| slug | privilege-commands |
Use this command to add a new privilege_name to an existing role. The privilege_name parameter can be a list of comma-separated privileges. You can further restrict this operation by specifying a database_name and/or a table_name.
GRANT PRIVILEGE privilege_name ROLE role_name [DATABASE database_name] [TABLE table_name]
USERADMIN
OK string or error value (see SCSP protocol).
> GRANT PRIVILEGE readwrite ROLE role1
OKThe LIST PRIVILEGES command returns a rowset that contains a list of all the privileges built into SQLite Cloud.
LIST PRIVILEGES
USERADMIN
A Rowset with one privilege name column.
> LIST PRIVILEGES
-----------------|
name |
-----------------|
NONE |
READ |
INSERT |
UPDATE |
DELETE |
READWRITE |
PRAGMA |
CREATE_TABLE |
CREATE_INDEX |
CREATE_VIEW |
CREATE_TRIGGER |
DROP_TABLE |
DROP_INDEX |
DROP_VIEW |
DROP_TRIGGER |
ALTER_TABLE |
ANALYZE |
ATTACH |
DETACH |
DBADMIN |
SUB |
PUB |
PUBSUB |
BACKUP |
RESTORE |
DOWNLOAD |
PLUGIN |
SETTINGS |
USERADMIN |
CLUSTERADMIN |
CLUSTERMONITOR |
CREATE_DATABASE |
DROP_DATABASE |
HOSTADMIN |
ADMIN |
PUBSUBCREATE |
-----------------|The SET PRIVILEGE command grants only specified privileges to a role. Previously granted privileges are revoked. The privilege_name parameter can be a list of comma-separated privileges.
SET PRIVILEGE privilege_name ROLE role_name [DATABASE database_name] [TABLE table_name]
USERADMIN
OK string or error value (see SCSP protocol).
> SET PRIVILEGE readwrite ROLE role1
OKUse this command to revoke a privilege (or a command-separated list of privileges) from the ROLE role_name. You can further restrict this command by specifying a database and/or a table name.
REVOKE PRIVILEGE privilege_name ROLE role_name [DATABASE database_name] [TABLE table_name]
USERADMIN
OK string or error value (see SCSP protocol).
> REVOKE PRIVILEGE privilege1 ROLE role1
OK