Skip to content

Commit 0f5e334

Browse files
committed
fix docs
1 parent 481e9e8 commit 0f5e334

File tree

1 file changed

+28
-32
lines changed

1 file changed

+28
-32
lines changed

lib/woqlClient.js

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,6 @@ const WOQLQuery = require('./query/woqlBuilder');
2323
* and connectionCapabilities.js - are used by the client to store internal state - they
2424
* should never have to be accessed directly. For situations where you want to communicate
2525
* with a TerminusDB server API, the WOQLClient class is all you will need.
26-
* @constructor
27-
* @param {string} serverUrl - the terminusdb server url
28-
* @param {typedef.ParamsObj} [params] - an object with the connection parameters
29-
* @example
30-
* //to connect with your local terminusDB
31-
* const client = new TerminusClient.WOQLClient(SERVER_URL,{user:"admin",key:"myKey"})
32-
* async function getSchema() {
33-
* client.db("test")
34-
* client.checkout("dev")
35-
* const schema = await client.getSchema()
36-
* }
37-
* //The client has an internal state which defines what
38-
* //organization / database / repository / branch / ref it is currently attached to
39-
*
40-
* //to connect with your TerminusDB Cloud Instance
41-
* const client = new TerminusClient.WOQLClient('SERVER_CLOUD_URL/mycloudTeam',
42-
* {user:"myemail@something.com", organization:'mycloudTeam'})
43-
*
44-
* client.setApiKey(MY_ACCESS_TOKEN)
45-
*
46-
* //to get the list of all organization's databases
47-
* async function callGetDatabases(){
48-
* const dbList = await client.getDatabases()
49-
* console.log(dbList)
50-
* }
51-
*
52-
* async function getSchema() {
53-
* client.db("test")
54-
* client.checkout("dev")
55-
* const schema = await client.getSchema()
56-
* }
5726
*/
5827

5928
class WOQLClient {
@@ -62,13 +31,40 @@ class WOQLClient {
6231
databaseList = [];
6332

6433
organizationList = [];
34+
6535
/**
6636
* @constructor
6737
* @param {string} serverUrl - the terminusdb server url
6838
* @param {typedef.ParamsObj} [params] - an object with the connection parameters
6939
* @example
40+
* //to connect with your local terminusDB
41+
* const client = new TerminusClient.WOQLClient(SERVER_URL,{user:"admin",key:"myKey"})
42+
* async function getSchema() {
43+
* client.db("test")
44+
* client.checkout("dev")
45+
* const schema = await client.getSchema()
46+
* }
47+
* //The client has an internal state which defines what
48+
* //organization / database / repository / branch / ref it is currently attached to
49+
*
50+
* //to connect with your TerminusDB Cloud Instance
51+
* const client = new TerminusClient.WOQLClient('SERVER_CLOUD_URL/mycloudTeam',
52+
* {user:"myemail@something.com", organization:'mycloudTeam'})
53+
*
54+
* client.setApiKey(MY_ACCESS_TOKEN)
55+
*
56+
* //to get the list of all organization's databases
57+
* async function callGetDatabases(){
58+
* const dbList = await client.getDatabases()
59+
* console.log(dbList)
60+
* }
61+
*
62+
* async function getSchema() {
63+
* client.db("test")
64+
* client.checkout("dev")
65+
* const schema = await client.getSchema()
66+
* }
7067
*/
71-
7268
constructor(serverUrl, params) {
7369
this.connectionConfig = new ConnectionConfig(serverUrl, params);
7470
}

0 commit comments

Comments
 (0)