You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-3Lines changed: 39 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@ Tools for dumping/loading a SQLite database to diffable directory structure
10
10
11
11
pip install sqlite-diffable
12
12
13
+
## Demo
14
+
15
+
The repository at [simonw/simonwillisonblog-backup](https://github.com/simonw/simonwillisonblog-backup) contains a backup of the database on my blog, https://simonwillison.net/ - created using this tool.
16
+
13
17
## Dumping a database
14
18
15
19
Given a SQLite database called `fixtures.db` containing a table `facetable`, the following will dump out that table to the `dump/` directory:
@@ -32,11 +36,43 @@ You can replace those tables (dropping them before restoring them) using the `--
32
36
33
37
sqlite-diffable load restored.db dump/ --replace
34
38
35
-
## Demo
39
+
## Converting to JSON objects
36
40
37
-
The repository at [simonw/simonwillisonblog-backup](https://github.com/simonw/simonwillisonblog-backup) contains a backup of the database on my blog, https://simonwillison.net/ - created using this tool.
41
+
Table rows are stored in the `.ndjson` files as newline-delimited JSON arrays, like this:
Each table is represented as two files. The first, `table_name.metadata.json`, contains metadata describing the structure of the table. For a table called `redirects_redirect` that file might look like this:
0 commit comments