File tree Expand file tree Collapse file tree 2 files changed +80
-1
lines changed
src/main/java/com/datastax/astra/shell/cmd/db Expand file tree Collapse file tree 2 files changed +80
-1
lines changed Original file line number Diff line number Diff line change @@ -197,12 +197,91 @@ astra help db create-keyspace
197
197
astra db cqlsh demo
198
198
```
199
199
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
+ ```
200
211
201
212
## D. Interactive mode
202
213
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
+ ```
203
261
204
262
## E. Working with Users
205
263
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
+
206
285
207
286
## F. Working with Roles
208
287
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public static Optional<DatabaseClient> getDatabaseClient(String db) {
130
130
return Optional .ofNullable (dbsClient .database (dbs .get (0 ).getId ()));
131
131
}
132
132
133
- ShellPrinter . outputError ( ExitCode . NOT_FOUND , "' " + db + "' database not found. " );
133
+ LoggerShell . warning ( "Database " + db + " has not been found" );
134
134
return Optional .empty ();
135
135
}
136
136
You can’t perform that action at this time.
0 commit comments