I want to import data on JSON file to PostgreSQL. But, i want to use bash script to do that. Name of the JSON file will represent of name of the table in PostgrSQL. And I have a few JSON to be imported into PostgreSQL. How to do that in bash script? I am using osx.
Please help me.
Here is the example of my JSON File.
[
{
"id": "101",
"name": "User Registered",
"description": "User has been registered. This is the first status after register.",
"created_at": "2017-11-25 15:41:28",
"updated_at": "2017-11-25 15:41:28"
},
{
"id": "102",
"name": "User active",
"description": "User is active. She/He has been confirm it by activation code that sent through email",
"created_at": "2017-11-25 15:41:28",
"updated_at": "2017-11-25 15:41:28"
},
{
"id": "103",
"name": "User deleted",
"description": "User request to delete her/his account",
"created_at": "2017-11-25 15:41:28",
"updated_at": "2017-11-25 15:41:28"
},
{
"id": "104",
"name": "User banned",
"description": "User get banned for some reason.",
"created_at": "2017-11-25 15:41:28",
"updated_at": "2017-11-25 15:41:28"
}
]