Skip to content

Commit e8dd5f8

Browse files
committed
more commands
1 parent 2fc1fc4 commit e8dd5f8

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

astra-shell/README.MD

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,91 @@ astra help db create-keyspace
197197
astra db cqlsh demo
198198
```
199199

200+
- Quit the shell
201+
202+
```
203+
quit;
204+
```
205+
206+
- Execute CQL (or CQL file)
207+
208+
```
209+
astra db cqlsh demo -e "describe keyspaces;"
210+
```
200211

201212
## D. Interactive mode
202213

214+
Commands we used so far are stateless, no connection is maintained after the execution. What if you need more an interactive shell than a cli ?
215+
216+
```
217+
astra
218+
```
219+
220+
- List the DB
221+
222+
```
223+
db list
224+
```
225+
226+
- Show a db
227+
228+
```
229+
db get demo
230+
```
231+
232+
Now what if we want some commands on this particular db ?
233+
234+
```
235+
db use demo
236+
```
237+
238+
```
239+
info
240+
```
241+
242+
> **Note**: *Still not sure about the info command to display the current context of the shell.*
243+
244+
- Create a keyspace
245+
246+
```
247+
create keyspace kso
248+
```
249+
250+
- Access the keyspace
251+
252+
```
253+
cqlsh -k kso
254+
```
255+
256+
Now quit:
257+
258+
```
259+
quit;
260+
```
203261

204262
## E. Working with Users
205263

264+
- List your users
265+
266+
```
267+
astra user list
268+
```
269+
270+
- Invite your best friend (me). The role will be DataStax Administrator by default
271+
272+
```
273+
astra user invite [email protected]
274+
astra db list
275+
```
276+
277+
- Delete a user
278+
279+
```
280+
astra user delete [email protected]
281+
```
282+
283+
284+
206285

207286
## F. Working with Roles
208287

astra-shell/src/main/java/com/datastax/astra/shell/cmd/db/OperationsDb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static Optional<DatabaseClient> getDatabaseClient(String db) {
130130
return Optional.ofNullable(dbsClient.database(dbs.get(0).getId()));
131131
}
132132

133-
ShellPrinter.outputError(ExitCode.NOT_FOUND,"'" + db + "' database not found.");
133+
LoggerShell.warning("Database " + db + " has not been found");
134134
return Optional.empty();
135135
}
136136

0 commit comments

Comments
 (0)