|
1 | | -# rai_db_sdk |
| 1 | +# relationalai-sdk |
2 | 2 |
|
3 | | -RaiDbSdk - JavaScript client for rai_db_sdk |
4 | | -This is a Client SDK for Delve API |
5 | | -This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
6 | | - |
7 | | -- API version: 1.2.0 |
8 | | -- Package version: 1.2.0 |
9 | | -- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen |
10 | | -For more information, please visit [https://www.relational.ai/support](https://www.relational.ai/support) |
| 3 | +RelationalAI SDK for JavaScript |
11 | 4 |
|
12 | 5 | ## Installation |
13 | 6 |
|
14 | | -### For [Node.js](https://nodejs.org/) |
15 | | - |
16 | | -#### npm |
17 | | - |
18 | | -To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). |
19 | | - |
20 | | -Then install it via: |
21 | | - |
22 | | -```shell |
23 | | -npm install rai_db_sdk --save |
24 | | -``` |
25 | | - |
26 | | -Finally, you need to build the module: |
27 | | - |
28 | | -```shell |
29 | | -npm run build |
30 | | -``` |
31 | | - |
32 | | -##### Local development |
33 | | - |
34 | | -To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: |
35 | | - |
36 | | -```shell |
37 | | -npm install |
38 | | -``` |
39 | | - |
40 | | -Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: |
41 | | - |
42 | | -```shell |
43 | | -npm link |
44 | | -``` |
45 | | - |
46 | | -To use the link you just defined in your project, switch to the directory you want to use your rai_db_sdk from, and run: |
47 | | - |
48 | | -```shell |
49 | | -npm link /path/to/<JAVASCRIPT_CLIENT_DIR> |
50 | | -``` |
51 | | - |
52 | | -Finally, you need to build the module: |
53 | | - |
54 | | -```shell |
55 | | -npm run build |
56 | | -``` |
57 | | - |
58 | | -#### git |
59 | | - |
60 | | -If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID |
61 | | -then install it via: |
62 | | - |
63 | | -```shell |
64 | | - npm install GIT_USER_ID/GIT_REPO_ID --save |
65 | 7 | ``` |
66 | | - |
67 | | -### For browser |
68 | | - |
69 | | -The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following |
70 | | -the above steps with Node.js and installing browserify with `npm install -g browserify`, |
71 | | -perform the following (assuming *main.js* is your entry file): |
72 | | - |
73 | | -```shell |
74 | | -browserify main.js > bundle.js |
| 8 | +npm install relationalai-sdk |
75 | 9 | ``` |
76 | 10 |
|
77 | | -Then include *bundle.js* in the HTML pages. |
| 11 | +## Usage |
78 | 12 |
|
79 | | -### Webpack Configuration |
80 | | - |
81 | | -Using Webpack you may encounter the following error: "Module not found: Error: |
82 | | -Cannot resolve module", most certainly you should disable AMD loader. Add/merge |
83 | | -the following section to your webpack config: |
84 | | - |
85 | | -```javascript |
86 | | -module: { |
87 | | - rules: [ |
88 | | - { |
89 | | - parser: { |
90 | | - amd: false |
91 | | - } |
92 | | - } |
93 | | - ] |
94 | | -} |
95 | 13 | ``` |
| 14 | +import { LocalConnection } from 'relationalai-sdk'; |
96 | 15 |
|
97 | | -## Getting Started |
98 | | - |
99 | | -Please follow the [installation](#installation) instruction and execute the following JS code: |
100 | | - |
101 | | -```javascript |
102 | | -var RaiDbSdk = require('rai_db_sdk'); |
103 | | - |
104 | | - |
105 | | -var api = new RaiDbSdk.DefaultApi() |
106 | | -var transaction = new RaiDbSdk.Transaction(); // {Transaction} Optional description in *Markdown* |
107 | | -var callback = function(error, data, response) { |
108 | | - if (error) { |
109 | | - console.error(error); |
110 | | - } else { |
111 | | - console.log('API called successfully. Returned data: ' + data); |
112 | | - } |
113 | | -}; |
114 | | -api.transactionPost(transaction, callback); |
115 | | - |
| 16 | +const localConnection = new LocalConnection(); |
| 17 | +let res = await localConnection.connectToDatabase('dbname'); |
116 | 18 | ``` |
117 | | - |
118 | | -## Documentation for API Endpoints |
119 | | - |
120 | | -All URIs are relative to *http://127.0.0.1:8010* |
121 | | - |
122 | | -Class | Method | HTTP request | Description |
123 | | ------------- | ------------- | ------------- | ------------- |
124 | | -*RaiDbSdk.DefaultApi* | [**transactionPost**](docs/DefaultApi.md#transactionPost) | **POST** /transaction | Issues a transaction to be executed |
125 | | - |
126 | | - |
127 | | -## Documentation for Models |
128 | | - |
129 | | - - [RaiDbSdk.AbstractProblem](docs/AbstractProblem.md) |
130 | | - - [RaiDbSdk.Action](docs/Action.md) |
131 | | - - [RaiDbSdk.ActionResult](docs/ActionResult.md) |
132 | | - - [RaiDbSdk.Appl](docs/Appl.md) |
133 | | - - [RaiDbSdk.ApplAllOf](docs/ApplAllOf.md) |
134 | | - - [RaiDbSdk.Area](docs/Area.md) |
135 | | - - [RaiDbSdk.AzureIntegration](docs/AzureIntegration.md) |
136 | | - - [RaiDbSdk.AzureIntegrationAllOf](docs/AzureIntegrationAllOf.md) |
137 | | - - [RaiDbSdk.CSVFileSchema](docs/CSVFileSchema.md) |
138 | | - - [RaiDbSdk.CSVFileSchemaAllOf](docs/CSVFileSchemaAllOf.md) |
139 | | - - [RaiDbSdk.CSVFileSyntax](docs/CSVFileSyntax.md) |
140 | | - - [RaiDbSdk.CSVFileSyntaxAllOf](docs/CSVFileSyntaxAllOf.md) |
141 | | - - [RaiDbSdk.CardinalityAction](docs/CardinalityAction.md) |
142 | | - - [RaiDbSdk.CardinalityActionAllOf](docs/CardinalityActionAllOf.md) |
143 | | - - [RaiDbSdk.CardinalityActionResult](docs/CardinalityActionResult.md) |
144 | | - - [RaiDbSdk.CardinalityActionResultAllOf](docs/CardinalityActionResultAllOf.md) |
145 | | - - [RaiDbSdk.ClientProblem](docs/ClientProblem.md) |
146 | | - - [RaiDbSdk.ClientProblemAllOf](docs/ClientProblemAllOf.md) |
147 | | - - [RaiDbSdk.CollectProblemsAction](docs/CollectProblemsAction.md) |
148 | | - - [RaiDbSdk.CollectProblemsActionAllOf](docs/CollectProblemsActionAllOf.md) |
149 | | - - [RaiDbSdk.CollectProblemsActionResult](docs/CollectProblemsActionResult.md) |
150 | | - - [RaiDbSdk.CollectProblemsActionResultAllOf](docs/CollectProblemsActionResultAllOf.md) |
151 | | - - [RaiDbSdk.Cons](docs/Cons.md) |
152 | | - - [RaiDbSdk.ConsAllOf](docs/ConsAllOf.md) |
153 | | - - [RaiDbSdk.DefaultIntegration](docs/DefaultIntegration.md) |
154 | | - - [RaiDbSdk.ExceptionProblem](docs/ExceptionProblem.md) |
155 | | - - [RaiDbSdk.ExceptionProblemAllOf](docs/ExceptionProblemAllOf.md) |
156 | | - - [RaiDbSdk.FileSchema](docs/FileSchema.md) |
157 | | - - [RaiDbSdk.FileSyntax](docs/FileSyntax.md) |
158 | | - - [RaiDbSdk.ICViolation](docs/ICViolation.md) |
159 | | - - [RaiDbSdk.ImportAction](docs/ImportAction.md) |
160 | | - - [RaiDbSdk.ImportActionAllOf](docs/ImportActionAllOf.md) |
161 | | - - [RaiDbSdk.ImportActionResult](docs/ImportActionResult.md) |
162 | | - - [RaiDbSdk.InfraError](docs/InfraError.md) |
163 | | - - [RaiDbSdk.InstallAction](docs/InstallAction.md) |
164 | | - - [RaiDbSdk.InstallActionAllOf](docs/InstallActionAllOf.md) |
165 | | - - [RaiDbSdk.InstallActionResult](docs/InstallActionResult.md) |
166 | | - - [RaiDbSdk.Integration](docs/Integration.md) |
167 | | - - [RaiDbSdk.IntegrityConstraintProblem](docs/IntegrityConstraintProblem.md) |
168 | | - - [RaiDbSdk.IntegrityConstraintProblemAllOf](docs/IntegrityConstraintProblemAllOf.md) |
169 | | - - [RaiDbSdk.IntegrityConstraintViolation](docs/IntegrityConstraintViolation.md) |
170 | | - - [RaiDbSdk.IntegrityConstraintViolationAllOf](docs/IntegrityConstraintViolationAllOf.md) |
171 | | - - [RaiDbSdk.JSONFileSchema](docs/JSONFileSchema.md) |
172 | | - - [RaiDbSdk.JSONFileSyntax](docs/JSONFileSyntax.md) |
173 | | - - [RaiDbSdk.LabeledAction](docs/LabeledAction.md) |
174 | | - - [RaiDbSdk.LabeledActionResult](docs/LabeledActionResult.md) |
175 | | - - [RaiDbSdk.LinkedList](docs/LinkedList.md) |
176 | | - - [RaiDbSdk.ListEdbAction](docs/ListEdbAction.md) |
177 | | - - [RaiDbSdk.ListEdbActionResult](docs/ListEdbActionResult.md) |
178 | | - - [RaiDbSdk.ListEdbActionResultAllOf](docs/ListEdbActionResultAllOf.md) |
179 | | - - [RaiDbSdk.ListSourceAction](docs/ListSourceAction.md) |
180 | | - - [RaiDbSdk.ListSourceActionResult](docs/ListSourceActionResult.md) |
181 | | - - [RaiDbSdk.Literal](docs/Literal.md) |
182 | | - - [RaiDbSdk.LiteralAllOf](docs/LiteralAllOf.md) |
183 | | - - [RaiDbSdk.LoadData](docs/LoadData.md) |
184 | | - - [RaiDbSdk.LoadDataAction](docs/LoadDataAction.md) |
185 | | - - [RaiDbSdk.LoadDataActionAllOf](docs/LoadDataActionAllOf.md) |
186 | | - - [RaiDbSdk.LoadDataActionResult](docs/LoadDataActionResult.md) |
187 | | - - [RaiDbSdk.ModifyWorkspaceAction](docs/ModifyWorkspaceAction.md) |
188 | | - - [RaiDbSdk.ModifyWorkspaceActionAllOf](docs/ModifyWorkspaceActionAllOf.md) |
189 | | - - [RaiDbSdk.ModifyWorkspaceActionResult](docs/ModifyWorkspaceActionResult.md) |
190 | | - - [RaiDbSdk.ModifyWorkspaceActionResultAllOf](docs/ModifyWorkspaceActionResultAllOf.md) |
191 | | - - [RaiDbSdk.Nil](docs/Nil.md) |
192 | | - - [RaiDbSdk.OutputProblem](docs/OutputProblem.md) |
193 | | - - [RaiDbSdk.OutputProblemAllOf](docs/OutputProblemAllOf.md) |
194 | | - - [RaiDbSdk.PairAnyValueAnyValue](docs/PairAnyValueAnyValue.md) |
195 | | - - [RaiDbSdk.PairSymbolString](docs/PairSymbolString.md) |
196 | | - - [RaiDbSdk.ParseAction](docs/ParseAction.md) |
197 | | - - [RaiDbSdk.ParseActionAllOf](docs/ParseActionAllOf.md) |
198 | | - - [RaiDbSdk.ParseActionResult](docs/ParseActionResult.md) |
199 | | - - [RaiDbSdk.PersistProblem](docs/PersistProblem.md) |
200 | | - - [RaiDbSdk.Point](docs/Point.md) |
201 | | - - [RaiDbSdk.QueryAction](docs/QueryAction.md) |
202 | | - - [RaiDbSdk.QueryActionAllOf](docs/QueryActionAllOf.md) |
203 | | - - [RaiDbSdk.QueryActionResult](docs/QueryActionResult.md) |
204 | | - - [RaiDbSdk.QueryActionResultAllOf](docs/QueryActionResultAllOf.md) |
205 | | - - [RaiDbSdk.Range](docs/Range.md) |
206 | | - - [RaiDbSdk.RelKey](docs/RelKey.md) |
207 | | - - [RaiDbSdk.Relation](docs/Relation.md) |
208 | | - - [RaiDbSdk.S3Integration](docs/S3Integration.md) |
209 | | - - [RaiDbSdk.SetOptionsAction](docs/SetOptionsAction.md) |
210 | | - - [RaiDbSdk.SetOptionsActionAllOf](docs/SetOptionsActionAllOf.md) |
211 | | - - [RaiDbSdk.SetOptionsActionResult](docs/SetOptionsActionResult.md) |
212 | | - - [RaiDbSdk.Source](docs/Source.md) |
213 | | - - [RaiDbSdk.StatusAction](docs/StatusAction.md) |
214 | | - - [RaiDbSdk.StatusActionResult](docs/StatusActionResult.md) |
215 | | - - [RaiDbSdk.StorageProblem](docs/StorageProblem.md) |
216 | | - - [RaiDbSdk.SyntaxError](docs/SyntaxError.md) |
217 | | - - [RaiDbSdk.SyntaxErrorAllOf](docs/SyntaxErrorAllOf.md) |
218 | | - - [RaiDbSdk.SyntaxNode](docs/SyntaxNode.md) |
219 | | - - [RaiDbSdk.Token](docs/Token.md) |
220 | | - - [RaiDbSdk.TokenAllOf](docs/TokenAllOf.md) |
221 | | - - [RaiDbSdk.Transaction](docs/Transaction.md) |
222 | | - - [RaiDbSdk.TransactionResult](docs/TransactionResult.md) |
223 | | - - [RaiDbSdk.UpdateAction](docs/UpdateAction.md) |
224 | | - - [RaiDbSdk.UpdateActionAllOf](docs/UpdateActionAllOf.md) |
225 | | - - [RaiDbSdk.UpdateActionResult](docs/UpdateActionResult.md) |
226 | | - - [RaiDbSdk.WorkspaceLoadProblem](docs/WorkspaceLoadProblem.md) |
227 | | - |
228 | | - |
229 | | -## Documentation for Authorization |
230 | | - |
231 | | -All endpoints do not require authorization. |
0 commit comments