在下一个js中进行Typeorm配置

问题描述 投票:0回答:1

我花了几天时间为 Next JS 配置 typeorm (postgresql),但没有成功。 大多数教程都解释了如何将 prisma 与 Next JS 一起使用。

以下是我采取的步骤:

  1. 我安装了
    pg, reflect-metadata, @types/react, @types/node, typeorm
  2. 我使用
    npx typeorm init
  3. 生成了 typeorm 文件
  4. 我编辑了 ormconfig.js

如何创建 typeorm 连接并在下一个 js 中使用它? 关于在 next.js 中使用 typeorm 有什么好的教程吗?

orm next.js typeorm
1个回答
0
投票

我建议你使用 prisma ORM。它也可以与 next js、vercel PostgreSQL 和 PostgreSQL 正常工作。 您可以查看 prisma 文档以获取更多信息。

© www.soinside.com 2019 - 2024. All rights reserved.