Skip to content

Commit 7d4fe66

Browse files
committed
docs: update README.md
1 parent 4eee207 commit 7d4fe66

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,42 @@
44

55
Using JSON as very lightweight database
66

7-
- Documentation: https://json-as-db.readthedocs.io/
7+
```python
8+
>>> db = client.create_database('table_1')
9+
>>> db.add([{
10+
... "id": "1001",
11+
... "type": "Regular"
12+
... }, {
13+
... "id": "1002",
14+
... "type": "Chocolate"
15+
... })
16+
['FqkmbYFSCRCAHQWydhM69v', 'RUJGcVBFANvNRReXa8U3En']
17+
>>> db.save(json_kwds={'indent': 4})
18+
```
19+
20+
```js
21+
// table_1.json
22+
{
23+
"created_at": "2022-12-25T16:50:02.459068",
24+
"creator": "json_as_db",
25+
"data": {
26+
"FqkmbYFSCRCAHQWydhM69v": {
27+
"id": "1001",
28+
"type": "Regular"
29+
},
30+
"RUJGcVBFANvNRReXa8U3En": {
31+
"id": "1002",
32+
"type": "Chocolate"
33+
}
34+
},
35+
"updated_at": "2022-12-25T16:51:36.276790",
36+
"version": "1.0.0"
37+
}
38+
```
39+
40+
## Documentation
41+
42+
- Read the Docs - https://json-as-db.readthedocs.io/
843

944
## Installation
1045

0 commit comments

Comments
 (0)