Skip to content

Commit

Permalink
Merge pull request #464 from codenotary/chore_upgrade_doc
Browse files Browse the repository at this point in the history
chore: new sql statements
  • Loading branch information
jeroiraz authored Nov 15, 2023
2 parents 2553687 + 6694c21 commit c2d8800
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/.vuepress/sidebar_master.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
6 changes: 6 additions & 0 deletions src/master/develop/sql/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

</WrappedSection>

<WrappedSection>
Expand All @@ -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.

</WrappedSection>

<WrappedSection>
Expand All @@ -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.

</WrappedSection>

<WrappedSection>
Expand Down
42 changes: 42 additions & 0 deletions src/master/develop/sql/users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# User Management

<WrappedSection>

### 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.

</WrappedSection>

<WrappedSection>

### ALTER USER

User password and permissions can be modified with the `ALTER USER` statement as follows:

```sql
ALTER USER user1 WITH PASSWORD 'newUser1Password!' ADMIN;
```

</WrappedSection>

<WrappedSection>

### 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;
```

</WrappedSection>

0 comments on commit c2d8800

Please sign in to comment.