Skip to content

Commit a839c68

Browse files
committed
Add Insert statement example on README
1 parent 4eaaee6 commit a839c68

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ client.score(query).then((resp) => {
10281028
### `sql(query)`
10291029
Retrieve inserted values using a SQL syntax. This method corresponds to a POST request at /query/sql.
10301030

1031-
#### Request example
1031+
#### Query statement
10321032

10331033
```javascript
10341034
let SlicingDice = require('slicerjs');
@@ -1047,6 +1047,24 @@ client.sql(query).then((resp) => {
10471047
});
10481048
```
10491049

1050+
#### Insert statement
1051+
```javascript
1052+
let SlicingDice = require('slicerjs');
1053+
1054+
const client = new SlicingDice({
1055+
masterKey: 'MASTER_KEY',
1056+
readKey: 'READ_KEY'
1057+
});
1058+
1059+
query = "INSERT INTO default([entity-id], name, age) VALUES(1, 'john', 10)";
1060+
1061+
client.sql(query).then((resp) => {
1062+
console.log(resp);
1063+
}, (err) => {
1064+
console.error(err);
1065+
});
1066+
```
1067+
10501068
#### Output example
10511069

10521070
```json

0 commit comments

Comments
 (0)