Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: new sql statements #464

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading