Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfathmuqoddas/generate-random-data
Shell Script for generating random json and sql data
https://github.com/alfathmuqoddas/generate-random-data
Last synced: about 6 hours ago
JSON representation
Shell Script for generating random json and sql data
- Host: GitHub
- URL: https://github.com/alfathmuqoddas/generate-random-data
- Owner: alfathmuqoddas
- Created: 2023-07-20T10:40:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-20T14:59:24.000Z (over 1 year ago)
- Last Synced: 2025-01-22T03:19:20.245Z (about 6 hours ago)
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shell Script for generating random json and sql
## Make the script executable
1. ```chmod +x generate_random_json_array.sh```
2. ```chmod +x generate_random_sql.sh```## Usage
1. ```$ ./generate_random_json_array.sh ```
2. ```$ ./generate_random_sql.sh ```## Sample Output
1. JSON ```$ ./generate_random_json_array.sh 3```
```
[
{
"id": 1,
"name": "William",
"age": 43,
"email": "[email protected]",
"address": {
"city": "Seattle",
"country": "USA"
},
"interests": "cooking"
},
{
"id": 2,
"name": "John",
"age": 27,
"email": "[email protected]",
"address": {
"city": "Los Angeles",
"country": "USA"
},
"interests": "traveling"
},
{
"id": 3,
"name": "Olivia",
"age": 37,
"email": "[email protected]",
"address": {
"city": "Boston",
"country": "USA"
},
"interests": "reading"
}
]
```2. SQL `$ ./generate_random_sql.sh 3`
```
INSERT INTO your_table (name, age, email, city, country, interests) VALUES ('John', 39, '[email protected]', 'Los Angeles', 'USA', 'traveling');
INSERT INTO your_table (name, age, email, city, country, interests) VALUES ('Bob', 57, '[email protected]', 'Los Angeles', 'USA', 'painting');
INSERT INTO your_table (name, age, email, city, country, interests) VALUES ('John', 55, '[email protected]', 'New York', 'USA', 'sports');
```