如何通过Prisma ORM基于现有数据在PostgreSQL中生成种子文件?

huangapple go评论57阅读模式
英文:

How to generate a seed file based on existing data in postgresql via prisma orm?

问题

我已解析了一些有关餐馆的数据并将它们加载到了我的本地数据库。如何通过Prisma ORM基于现有数据库中的数据生成种子文件?

英文:

I have parsed some data about restaurants and loaded them to my local database. How can I generate a seed file based on existing data in db via prisma orm?

答案1

得分: 1

制作一个 seed.js 文件

连接到您的本地数据库,检索数据后可以批量插入到任何 prisma 支持的支持的数据库。

英文:

make a seed.js

connect to your local database,
after retrieving you can bulk insert the data to any supported database which prisma supports.

huangapple
  • 本文由 发表于 2023年5月28日 02:38:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76348464.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定