Skip to content
Discussion options

You must be logged in to vote

Okay. Let's do it step by step.

Models

Make sure you have models created inside app/Models directory. The job of a model is to query a single database table. For example: The User will conventionally query the users database table. For Example:

await User.all() // select * from users;
await User.findBy(params.id) // select * from users where id = ?;

Fake data

Fake data can come from anywhere. For example: You can insert fake data from a JSON file to your database. Or you can use factories to do that.

Now of course adding fake data to the database action has to happen without creating any route (HTTP endpoint). So we will use seeders for that. Here's the documentation on seeders https://pr…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by RomainLanz
Comment options

You must be logged in to vote
2 replies
@RomainLanz
Comment options

@vnugent
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants