【问题标题】:can not seed supabase using Prisma in nextjs project无法在 nextjs 项目中使用 Prisma 播种 supabase
【发布时间】:2023-02-19 04:04:36
【问题描述】:

我无法从我的项目中使用 Prisma 为 supabase 数据库播种

我在 package.json 中添加了种子脚本

"prisma": {
    "seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},

在种子文件中 删除以前的记录然后创建许多条目。

await client.category.deleteMany();

const categories = await client.category.createMany({
    data: [
        {
            name: "swimming",
        },
    ],
});

但得到错误:

错误:命令是 被 SIGSEGV 杀死(分段错误):ts-node --compiler-options {“模块”:“CommonJS”} prisma/seed.ts

【问题讨论】:

  • 我收到了那个错误,这就是我看到这篇文章的原因。但是 {\"module\":\"CommonJS\"} 与打字稿不兼容,对吗?

标签: next.js prisma supabase


【解决方案1】:

supabase 会给你连接字符串选项,选择`URI

【讨论】:

    猜你喜欢
    • 2023-01-11
    • 2022-01-10
    • 2022-12-21
    • 2023-02-20
    • 1970-01-01
    • 2022-12-30
    • 2020-05-09
    • 2021-06-11
    • 1970-01-01
    相关资源
    最近更新 更多