Skip to content

Commit 81ac84b

Browse files
committed
modify endpoint constructor align with python client
eg: https://dbid-us-central1.apps.astra.datastax.com use default_keyspace
1 parent a2ec3de commit 81ac84b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/collections/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,10 @@ export class AstraDB extends Client {
158158
constructor(...args: any[]) {
159159
// token: string, path: string
160160
if (args.length === 2) {
161-
const keyspaceName = getKeyspaceName(args[1]);
162-
super(args[1], keyspaceName, { isAstra: true, applicationToken: args[0] });
161+
let endpoint = args[1];
162+
endpoint += "/api/json/v1";
163+
endpoint += "/default_keyspace";
164+
super(endpoint, "default_keyspace", { isAstra: true, applicationToken: args[0] });
163165
} else {
164166
// token: string, dbId: string, region: string, keyspace?: string
165167
const keyspaceName = args[3] || "default_keyspace";

0 commit comments

Comments
 (0)