File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
astra-db-client/src/test/java/com/dtsx/astra/sdk/documentation Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 22
33import com .dtsx .astra .sdk .AstraDBAdmin ;
44import com .dtsx .astra .sdk .db .domain .Database ;
5-
65import java .util .Optional ;
76import java .util .UUID ;
87import java .util .stream .Stream ;
98
109public class FindDatabase {
11- public static void main (String [] args ) {
12-
13- AstraDBAdmin client = new AstraDBAdmin ("<replace_with_token>" );
10+ public static void main (String [] args ) {
11+ AstraDBAdmin client = new AstraDBAdmin ("<token>" );
1412
15- // Check is a database exists
16- boolean exists = client .isDatabaseExists ("<replace_with_db_name >" );
13+ // Check if a database exists
14+ boolean exists = client .isDatabaseExists ("<database_name >" );
1715
18- // Find a database from its name (name does not ensure unicity)
19- Stream <Database > dbStream = client .findDatabaseByName ("<replace_with_db_name>" );
20- Optional <Database > dbByName = dbStream
21- .findFirst ();
16+ // Find a database by name (names may not be unique)
17+ Stream <Database > dbStream = client .findDatabaseByName ("<database_name>" );
18+ Optional <Database > dbByName = dbStream .findFirst ();
2219
23- // Find a database from its id
24- Optional <Database > dbById = client
25- .findDatabaseById (UUID .fromString ("<replace_with_db_uuid>" ));
26- }
20+ // Find a database by ID
21+ Optional <Database > dbById = client
22+ .findDatabaseById (UUID .fromString ("<replace_with_db_uuid>" ));
23+ }
2724}
You can’t perform that action at this time.
0 commit comments