Skip to content

Commit 2c56c9a

Browse files
authored
Merge pull request #7623 from lichuang/share_rfc
docs: refactor share rfc, add select from db and show tables SQL
2 parents 7aa820a + 0373398 commit 2c56c9a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/doc/60-contributing/03-rfcs/20220809-share.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ To support creating and managing shares, Databend provides the following set of
7676
- Describe Share
7777
- Show Grants
7878
- Create Database, Table FROM Share
79+
- Select data from the Share DB tables
80+
- Show shared database tables
7981

8082
### Create Share
8183

@@ -210,6 +212,33 @@ Syntax:
210212
CREATE DATABASE <name> FROM SHARE <provider_tenant>.<share_name>
211213
```
212214

215+
216+
217+
### Select data from the Share DB tables
218+
219+
After tenants have created a database from a shared database, tenants can select data from the shared table like a normal table, before that the providers MUST have permitted access permission to the shared database and table.
220+
221+
Syntax:
222+
223+
```sql
224+
Select * from <share_db_name>.<table_name>
225+
```
226+
227+
228+
229+
### Show shared database tables
230+
231+
After tenants have created a database from a shared database, tenants can show tables from the shared database, it only outputs the tables which have been permitted to access.
232+
233+
Syntax:
234+
235+
```sql
236+
use <share_db_name>;
237+
show tables;
238+
```
239+
240+
241+
213242
## Example of Using Share with SQL
214243

215244
To create a share using SQL:

0 commit comments

Comments
 (0)