-
Notifications
You must be signed in to change notification settings - Fork 0
index API
npm install @aicore/cocodb-ws-clientimport * as coco from "@aicore/cocodb-ws-client"; // to import all functionsCreate a connection to the cocoDbServiceEndPoint and listens for messages. The connection will be maintained and it will try to automatically re-establish broken connections if there are network issues. You need to await on this function before staring to use any db APIs. Any APIs called while the connection is not fully setup will throw an error.
-
cocoDbServiceEndPoint[string][1] The URL of the coco-db service. -
authKey[string][1] The authKey is a base64 encoded string of the username and password.
Returns [Promise][2]<null> Resolves when the cocodb client is ready to send/receive requests for the first time.
Rejects only if the user calls close API before any connection is established.
await db.init("ws://endpoint.coco", "your_auth_key");See this wiki for detailed API docs
- https://github.com/aicore/cocoDbWsClient/wiki/api-API
- More coco lib level detailed docs can be found at https://github.com/aicore/libmysql/wiki/db-API
Closes the connection to the server. You need to await on this function before you can call init again.
Returns [Promise][2]<null> Resolves when the cocodb client is closed and you are free to call init again. Never rejects.
await db.close();