Installation
Automatic Installation - Setup Wizard
Run the following command in your terminal to start our handy install wizard:
It will guide you through the installation process and help you set up your project.
Once you've completed installation, run your Seed script with the following command:
Manual Installation
If you prefer to do things manually, you can follow these steps.
1. Install the required dev dependencies
2. Configure Seed
Seed is configured using the seed.config.ts
file.
Your need to specify an adapter in order for Seed to connect to your database.
For this example, we assume you are using PostgreSQL as your database and want to connect to it with the Postgres.js adapter:
3. Generate your Seed Client
Now that you have configured Seed, you can generate your Seed Client by running the following command:
This command will introspect your database schema and generate the necessary files for your Seed Client.
4. Create and execute your first Seed script
Create a new seed.ts
file.
We assume that you have a table called users
in your database.
Executing this script will delete all data in your database and seed it with 10 users. Make sure to adjust the script to your needs.
You can now execute your Seed script by running the following command:
Happy seeding! 🌱