Replies: 2 comments
-
you could send a request to the REST api with const db = new Arango.Database(config);
const status$ = db.request({method: "GET", path: `_db/${db.name}/_api/_admin/status`}); // retry in .catch That's how I do it, basically. Though it would be REALLY nice to have an api for this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
There's no way to know if the credentials and connection details are valid without talking to the database. The canonical way to test if your settings are valid is to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There's no API that returns the validity of connection to database. https://arangodb.github.io/arangojs/latest/classes/_database_.database.html#name re
new Database(config?: Config): Database new Database(url: string | string[], name?: undefined | string): Database useBasicAuth(username?: string, password?: string): this
Usage example:
const db = new Database({ url: "http://localhost:8529", databaseName: "my_database", auth: { username: "admin", password: "hunter2" }, });
all APIs return a database object but don't tell whether the connection was successful with given credentials or not.
So, how to check whether the program is connected to database successfully or not?
Beta Was this translation helpful? Give feedback.
All reactions