Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create Seeder? #10

Open
bogordesaincom opened this issue Jan 19, 2024 · 2 comments
Open

How to create Seeder? #10

bogordesaincom opened this issue Jan 19, 2024 · 2 comments

Comments

@bogordesaincom
Copy link

How to create Seeder?

@kiddyuchina
Copy link
Member

Currently, Sutando does not have a seeder feature, but you can manually write database insertion statements to populate your database. For example, you can use code similar to the following to insert data:

const now = new Date;
await sutando.table('users').insert([
  { name: 'Jack', created_at: now, updated_at: now },
  { name: 'Mark', created_at: now, updated_at: now },
]);

You can modify the fields and values in the insertion statement according to your needs.

@jjjrmy
Copy link
Contributor

jjjrmy commented Jan 22, 2024

Would be cool to add Faker and Model Factory Seeders.
It's probably not so hard to do Seeders without the Model Factories, we can just add another cli command.
What do you think @kiddyuchina ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants