diff options
| author | Ali Vakilzade <ali@vakilzade.com> | 2020-06-16 15:51:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-16 16:51:58 +0200 |
| commit | e29637681be07606674cdccb47d1e53acb930f5b (patch) | |
| tree | 6a0fc79e94b4bfd5b137a09ee83955100e9b39cc /docs | |
| parent | ea3beb4f5a61870c87ba028369de4d2c2f316ad0 (diff) | |
Fixed #30190 -- Added JSONL serializer.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/3.2.txt | 5 | ||||
| -rw-r--r-- | docs/topics/serialization.txt | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt index 6b2fb41144..1bb4dbed1e 100644 --- a/docs/releases/3.2.txt +++ b/docs/releases/3.2.txt @@ -215,7 +215,10 @@ Security Serialization ~~~~~~~~~~~~~ -* ... +* The new :ref:`JSONL <serialization-formats-jsonl>` serializer allows using + the JSON Lines format with :djadmin:`dumpdata` and :djadmin:`loaddata`. This + can be useful for populating large databases because data is loaded line by + line into memory, rather than being loaded all at once. Signals ~~~~~~~ diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index fc27a76138..7cc4905da3 100644 --- a/docs/topics/serialization.txt +++ b/docs/topics/serialization.txt @@ -160,11 +160,14 @@ Identifier Information ``json`` Serializes to and from JSON_. +``jsonl`` Serializes to and from JSONL_. + ``yaml`` Serializes to YAML (YAML Ain't a Markup Language). This serializer is only available if PyYAML_ is installed. ========== ============================================================== .. _json: https://json.org/ +.. _jsonl: http://jsonlines.org/ .. _PyYAML: https://pyyaml.org/ XML @@ -307,6 +310,24 @@ The JSON serializer uses ``DjangoJSONEncoder`` for encoding. A subclass of .. _ecma-262: https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15 +.. _serialization-formats-jsonl: + +JSONL +----- + +.. versionadded:: 3.2 + +*JSONL* stands for *JSON Lines*. With this format, objects are separated by new +lines, and each line contains a valid JSON object. JSONL serialized data look +like this:: + + { "pk": "4b678b301dfd8a4e0dad910de3ae245b", "model": "sessions.session", "fields": { ... }} + { "pk": "88bea72c02274f3c9bf1cb2bb8cee4fc", "model": "sessions.session", "fields": { ... }} + { "pk": "9cf0e26691b64147a67e2a9f06ad7a53", "model": "sessions.session", "fields": { ... }} + +JSONL can be useful for populating large databases, since the data can be +processed line by line, rather than being loaded into memory all at once. + YAML ---- |
