Alias: blitz c
Starts a Node.js REPL with your database and all your queries and mutations preloaded.
This makes it very simple to read or write to your database and run one-off commands using your queries or mutations. It's also great for testing and rapid prototype exploration.
Option | Shorthand | Description | Default |
---|---|---|---|
--env | -e | Set app environment name. Read more. | None |
--only-db | -d | Skip preloading queries and mutations. Only load the database module. | false |
> blitz console
You have entered the Blitz console
Tips: - Exit by typing .exit or pressing Ctrl-D
- Use your db like this: db.project.findMany()
- Use your queries/mutations like this: getProjects()
✔ Loading your code
⚡ > db.question.findMany()
[
{
id: 1,
createdAt: 2020-06-15T15:06:14.959Z,
updatedAt: 2020-06-15T15:06:14.959Z,
text: "What's up?"
}
]