Skip to content

Commit c582278

Browse files
committed
Clean up Readme
1 parent 508e9f1 commit c582278

File tree

1 file changed

+11
-32
lines changed

1 file changed

+11
-32
lines changed

README.md

+11-32
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
You can install this project using pip:
1919

2020
```bash
21-
pip install xtdb
21+
$ pip install xtdb
2222
```
2323

2424
## Usage
@@ -30,7 +30,7 @@ $ docker run -p 3000:3000 -d juxt/xtdb-standalone-rocksdb:1.21.0
3030
$ export XTDB_URI=http://localhost:3000/_xtdb
3131
```
3232

33-
### Using the client
33+
### Using the Client
3434

3535
The `XTDBClient` supports the full [HTTP API spec](https://docs.xtdb.com/clients/http/).
3636

@@ -48,7 +48,9 @@ The `XTDBClient` supports the full [HTTP API spec](https://docs.xtdb.com/clients
4848
{'name': 'fred', 'xt/id': '123'}
4949
```
5050

51-
### Datalog Query Support
51+
Take a look at the spec to see the full range of functionality that maps directly to the client.
52+
53+
### Using the Datalog module
5254

5355
The [datalog](xtdb/datalog.py) module also provides a layer to construct queries with more easily.
5456
Given the data from [the cities example](examples/cities) has been seeded:
@@ -65,7 +67,7 @@ Given the data from [the cities example](examples/cities) has been seeded:
6567

6668
To see more datalog query examples, check out the [unit tests](tests/test_datalog.py).
6769

68-
### Using the ORM
70+
### Using the ORM and Session
6971

7072
Below is an example of how to use the ORM functionality.
7173

@@ -109,41 +111,18 @@ This package also comes with an easy CLI tool to query XTDB.
109111
To query XTDB using a plain query you can run
110112

111113
```bash
112-
$ echo '{:query {:find [(pull ?e [*])] :where [[ ?e :name "fred" ]]}}' | python -m xtdb | jq
113-
[
114-
[
115-
{
116-
"xt/id": "123"
117-
"name": "fred",
118-
"somenil": null,
119-
"somedict": {
120-
"c": 3,
121-
"a": "b"
122-
},
123-
}
124-
]
125-
]
114+
$ echo '{:query {:find [(pull ?e [*])] :where [[ ?e :name "fred" ]]}}' | python -m xtdb
115+
[[{"name": "fred", "xt/id": "123"}]]
126116
```
127117

128118
To use a query file the command can be modified to the following:
129119

130120
```bash
131121
$ cat query.txt
132122
{:query {:find [(pull ?e [*])] :where [[ ?e :name "fred" ]]}}
133-
$ python -m xtdb < query.txt | jq
134-
[
135-
[
136-
{
137-
"xt/id": "123"
138-
"name": "fred",
139-
"somenil": null,
140-
"somedict": {
141-
"c": 3,
142-
"a": "b"
143-
},
144-
}
145-
]
146-
]
123+
$
124+
$ python -m xtdb < query.txt
125+
[[{"name": "fred", "xt/id": "123"}]]
147126
```
148127

149128
## Contributing

0 commit comments

Comments
 (0)