https://github.com/richardiambert/seed-db
A database seeding utility
https://github.com/richardiambert/seed-db
database javascript postgres seeding
Last synced: 3 months ago
JSON representation
A database seeding utility
- Host: GitHub
- URL: https://github.com/richardiambert/seed-db
- Owner: richardIambert
- Created: 2025-04-15T10:06:58.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-16T09:31:37.000Z (6 months ago)
- Last Synced: 2025-04-16T21:26:37.344Z (6 months ago)
- Topics: database, javascript, postgres, seeding
- Language: JavaScript
- Homepage:
- Size: 153 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# seed-db 🌱
A database seeding utility for postgres.
## Setup
### 1. Clone the repository
```bash
git clone https://github.com/richardIambert/seed-db.git
cd seed-db
```### 2. Install dependencies
```bash
npm install
```### 3. Setup environment variables
Create `.env.development` and `.env.test` files in the project root directory.
```.env
# .env.development
PGDATABASE=
``````.env
# .env.test
PGDATABASE=
```### 4. Run the utility
Ensure postgres is running and run the following npm scripts:
```bash
npm run setup-dbs
npm run seed-dev
```### 5. Check tables have been created
You can check that the seed was successful by running `npm run query-test-db` or `npm run query-dev-db` and then viewing `test-db.results.txt` and `dev-db.results.txt` respectively.