Closed rohfle closed 2 years ago
I worked out buffalo pop migrate
is executing buffalo-pop
as a child process
strace -f buffalo pop migrate 2>&1 | grep execve
[pid 648698] execve("/usr/local/bin/go", ["go", "env", "GOPATH"], 0xc0000da000 /* 52 vars */ <unfinished ...>
[pid 648698] <... execve resumed>) = 0
[pid 648706] execve("/home/user/go/bin/buffalo-pop", ["/home/user/go/bin/buffa"..., "pop", "migrate"], 0xc00054c540 /* 54 vars */ <unfinished ...>
[pid 648706] <... execve resumed>) = 0
To fix the issue I ran
go install -tags sqlite -v github.com/gobuffalo/buffalo-pop/v3
buffalo pop migrate
now works
pop v6.0.5
[POP] 2022/08/07 14:18:25 info - Migrations already up to date, nothing to apply
[POP] 2022/08/07 14:18:25 info - 0.0082 seconds
[POP] 2022/08/07 14:18:25 info - dumped schema for development.sqlite
Thank you for filing an issue with details.
Yes, the CLI (and the plugins) will be installed without sqlite3 support if --db-type
argument is not given. Like your case, if the user uses different databases for the development and the production, these manual steps need to be performed by the user themselves. (It is similar to the users who use sqlite3 on one project and use the other database in another project developed on the same development workstation since the plugin can be reinstalled by the other project.) Actually, this is the same for me since I love to use sqlite3. :-)
This issue is known but slightly tricky. The discussion about it is on https://github.com/gobuffalo/cli/discussions/184 for your information. (I will close this issue and please feel free to add your comments on the discussion)
This is the first time I've played around with buffalo. I had trouble getting sqlite3 working as a database while following the getting started docs and thought I would share what I did.
What I did From https://gobuffalo.io/documentation/getting_started/installation/
go install -tags sqlite github.com/gobuffalo/cli/cmd/buffalo@v0.18.8
- OKFrom https://gobuffalo.io/documentation/getting_started/new-project/ and https://dev.to/alexmercedcoder/api-with-go-buffalo-in-2021-from-zero-to-deploy-5642
buffalo new project1 --api
- OKThen I wanted to change database type to sqlite for development in
database.yml
But I got this error when running
buffalo dev
To fix this, I have to browse through issues and slack and read between the lines. I set the following in
config/buffalo-app.toml
And set the following in
config/buffalo-plugins.toml
Then
buffalo dev
worksSomewhere I learn about using the
--db-type
arg likebuffalo new project1 --db-type sqlite3
, which gets me to the same point. I have to changedatabase.yml
as I want to use sqlite3 for development but not for testing and production. Also paths are absolute (not relative to project directory), so if the project moves this would need to be updated.When I try to run
buffalo pop migrate
I getwhich soda
andwhich pop
gives no result so I assume that pop is embedded inbuffalo
. But weird that sqlite3 support is present fordev
but not forpop
. Not sure how to proceed with this one.