Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating the Photon Go client with setup tutorial in README.md #49

Closed
zafhiel opened this issue Dec 12, 2019 · 2 comments
Closed

Generating the Photon Go client with setup tutorial in README.md #49

zafhiel opened this issue Dec 12, 2019 · 2 comments
Milestone

Comments

@zafhiel
Copy link

zafhiel commented Dec 12, 2019

Hi guys, I'm very amazed at this version of prisma2 with photongo I want to test, but I have a problem with generating the Photon Go client.

I try to describe all the steps to reproduce:

New instance Ubuntu 18.04

  1. Update apt , install npm and prisma
apt update
apt install npm
npm i -g --unsafe-perm prisma2@alpha # I try all versions
  1. Install Golang and Photongo
wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.13.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go get github.com/prisma/photongo
  1. following the steps of the tutorial setup README.md, at step 4
mkdir app
nano schema.prisma # Paste all content from Setup Tutorial step 2
go run github.com/prisma/photongo lift save --create-db --name "init" # Works! 
go run github.com/prisma/photongo lift up # Works!
  1. Here is the problem, i ran this command and nothnig happens, no error but does not generate my .go file
go run github.com/prisma/photongo generate # Nothing happens

I try to modify the ouput here:

generator photon {
  provider = "photongo"
  output = "./photon/photon_gen.go"
  package = "photon"
}

The same result with:

output = "/root/app/photon_gen.go"

I'm trying a lot of scenarios and always in the command generate nothing happens, I need help!

im sorry for my english! saludos a todos!! 😜

@steebchen
Copy link
Owner

steebchen commented Dec 12, 2019

I'm so happy that you already gave Photon Go a shot, but please note that Photon Go is currently under heavy development and an experimental project. Some things are far from ideal right now, especially regarding documentation.

The problem you're having is due to prisma/prisma#934. Until this is fixed, you need to specify an absolute path for the photongo provider, which you can find out with which photongo after installing the library. For example, on Mac this would look like this:

generator photon {
	provider = "/Users/luca/go/bin/photongo"
	output = "./photon/photon_gen.go"
	package = "photon"
}

Please note that you do not need to have NodeJS/prisma2 installed anymore :)

@zafhiel
Copy link
Author

zafhiel commented Dec 12, 2019

thanks for all your comments @steebchen, works perfectly

@zafhiel zafhiel closed this as completed Dec 12, 2019
@steebchen steebchen added this to the v0.0.1 milestone Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants