Skip to content

Commit d8122f8

Browse files
committed
Add SQL section to README
1 parent c14f13c commit d8122f8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,31 @@ print(client.score(query))
859859
}
860860
```
861861

862+
### `sql(query)`
863+
Retrieve inserted values using a SQL syntax. This method corresponds to a POST request at /query/sql.
864+
865+
#### Request example
866+
867+
```python
868+
from pyslicer import SlicingDice
869+
client = SlicingDice('MASTER_OR_READ_API_KEY')
870+
query = "SELECT COUNT(*) FROM default WHERE age BETWEEN 0 AND 49"
871+
print(client.sql(query))
872+
```
873+
874+
#### Output example
875+
876+
```json
877+
{
878+
"took":0.063,
879+
"result":[
880+
{"COUNT": 3}
881+
],
882+
"count":1,
883+
"status":"success"
884+
}
885+
```
886+
862887
## License
863888

864889
[MIT](https://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)