Blitz 尚在 beat 阶段! 🎉 预计会在今年的 Q3 季度发布 1.0
Back to Documentation Menu

blitz console

别名:blitz c

启动 Node.js REPL,并预加载 database 和所有 queriesmutations

这使得读取或写入数据库以及使用 queries 或 mutations 运行一次性命令变得非常 简单。它也非常适合测试和快速原型探索。

Examples

> blitz console

You have entered the Blitz console
Tips: - Exit by typing .exit or pressing Ctrl-D
      - Use your db like this: await db.project.findMany()
      - Use your queries/mutations like this: await getProjects()
✔ Loading your code

⚡ > await db.question.findMany()
[
  {
    id: 1,
    createdAt: 2020-06-15T15:06:14.959Z,
    updatedAt: 2020-06-15T15:06:14.959Z,
    text: "What's up?"
  }
]

Idea for improving this page? Edit it on GitHub.