Reputation: 290
I got json database dump file to import into postgres but this file is not sql file (which I know how to import) it is json file. Its structure looks like this:
[
{
"model": "model.name",
"pk": 1,
"fields": {
"version": 1584369114566125,
"field_a": "something",
"field_b": "something"
}
},
{
"model": "model.name",
"pk": 1,
"fields": {
"version": 1584369114566125,
"field_a": "something",
"field_b": "something"
}
},
...
]
I want to import it but I don't know if is there option for importing database in such format and structure without writing sql function? I was trying to find if there is in documentation of pg_dump any option for exporting in json but I didn't find. My guess is also that server is written in django and maybe django has script for exporting/importing database in such file?
Upvotes: 1
Views: 1404