spiral-packages/database-seeder

The package provides the ability to seed your database with data using seed classes

3.2.0 2024-01-19 07:08 UTC

README

Database Seeder

PHP Latest Version on Packagist GitHub Tests Action Status Total Downloads

When you build apps that use databases, it's really important to make sure your database works right. This means checking if it stores, changes, and gives back data the way it's supposed to. But sometimes, testing databases can be tricky and a bit boring. You might have to write a lot of complicated commands and be very careful about how data is added or removed.

What the package offers

  1. Easy Testing: With Spiral, you don't need to deal with complex commands. The tools are simple to use, which means your tests are easier to write and understand.

  2. Different Ways to Reset Your Database: After you test something, you need to make your database clean again for the next test. Spiral has different ways to do this, like the Transaction, Migration, Refresh, and SqlFile methods. Each one has its own way of working, so you can choose what fits best for your test.

  3. Seeders and Factories: These are like shortcuts to fill your database with test data. This data looks like the real data you would use in your app. You can quickly set up the data you need for testing with these tools.

  4. Checking Your Database: After you do something in your database, you want to make sure it worked right. Spiral's tools let you check if the data is there or not, and if your database structure is correct.

It's a great for any developer, no matter how much experience you have. They help make sure your database is doing what it should, which is really important for your app to work well.

Requirements

Make sure that your server is configured with following PHP version and extensions:

  • PHP 8.1+
  • Spiral framework 3.7+

Documentation, Installation, and Usage Instructions

See the documentation for detailed installation and usage instructions.

License

The MIT License (MIT). Please see License File for more information.