-
Hello! So, I've been trying to seed database with Prisma with no success. The problem is that Go doesn't allow us to have more than one main function in main package, even in different file. Executing package other than main also not allowed. Is there anyone who has a way to create a seed script in Go with Hope some of you know the way, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use a different package (instead of a different file in the same package. The package folder can be anything, but the package name in the Go file needs to be Create a folder
Then run it via:
Let me know if that helps. |
Beta Was this translation helpful? Give feedback.
You can use a different package (instead of a different file in the same package. The package folder can be anything, but the package name in the Go file needs to be
main
. Then you can add a main function there and run it via CLI.Create a folder
seed
in the root of your project, and create a fileseed.go
(but both folder and file name can be anything).Then run it via:
Let me know if that helps.