diff --git a/src/.vuepress/sidebar_master.js b/src/.vuepress/sidebar_master.js index 159154416..1e40200a4 100644 --- a/src/.vuepress/sidebar_master.js +++ b/src/.vuepress/sidebar_master.js @@ -125,6 +125,7 @@ export default version => { developSQL.children.push(`${version}/develop/sql/insertupdate`); developSQL.children.push(`${version}/develop/sql/indexes`); developSQL.children.push(`${version}/develop/sql/querying`); + developSQL.children.push(`${version}/develop/sql/users`); developSQL.children.push(`${version}/develop/sql/catalog`); developSQL.children.push(`${version}/develop/sql/sqlstdlib`); developSQL.children.push(`${version}/develop/sql/pg`); diff --git a/src/master/develop/sql/catalog.md b/src/master/develop/sql/catalog.md index efe9cd151..3e17b62ee 100644 --- a/src/master/develop/sql/catalog.md +++ b/src/master/develop/sql/catalog.md @@ -23,6 +23,8 @@ This source can also be constrained using the `WHERE` clause and the set of colu SELECT name FROM DATABASES() WHERE name LIKE '.*db1.*'; ``` +Alternatively, the `SHOW DATABASES` statement returns the list of databases that can be accessed by the current user. + @@ -43,6 +45,8 @@ SELECT name FROM TABLES() WHERE name like '.*est.*' ``` +Alternatively, the `SHOW TABLES` statement returns the list of tables in the currently selected database. + @@ -65,6 +69,8 @@ SELECT "table", "name", "type" FROM COLUMNS('mytable'); SELECT name FROM COLUMNS('mytable') WHERE type = 'VARCHAR'; ``` +Alternatively, the `SHOW TABLE mytable` statement will returns the list of columns for the specified table. + diff --git a/src/master/develop/sql/users.md b/src/master/develop/sql/users.md new file mode 100644 index 000000000..69f527335 --- /dev/null +++ b/src/master/develop/sql/users.md @@ -0,0 +1,42 @@ +# User Management + + + +### CREATE USER + +Users can be created with the `CREATE USER` statement as follows: + +```sql +CREATE USER user1 WITH PASSWORD 'user1Password!' READWRITE; +``` + +Possible permissions are: `READ`, `READWRITE` and `ADMIN`. + +An admin user is able to fully manage the current database. + + + + + +### ALTER USER + +User password and permissions can be modified with the `ALTER USER` statement as follows: + +```sql +ALTER USER user1 WITH PASSWORD 'newUser1Password!' ADMIN; +``` + + + + + +### DROP USER + +An existing user can be deleted. +Deletion is logically done and the user can be reactivated by executing an `ALTER USER` statement. + +```sql +DROP USER user1; +``` + + \ No newline at end of file