Home > Article > Backend Development > Go Buffalo test sqlite error: Connection named test not found
php editor Xinyi discovered that when using Go Buffalo for testing, you may encounter a sqlite error, prompting that the connection named test cannot be found. This error may affect the normal progress of the test and we need to find a solution. The following will introduce some possible causes of this error and provide solutions to help developers solve the problem smoothly.
I am getting buffalo test errors on new projects I created using this command.
buffalo new coke --db-type sqlite3 buffalo test
This is an error:
[POP] 2023/02/23 13:43:02 warn - unable to load connection development: could not create new connection: sqlite3 support was not compiled into the binary [POP] 2023/02/23 13:43:02 warn - unable to load connection test: could not create new connection: sqlite3 support was not compiled into the binary [POP] 2023/02/23 13:43:02 warn - unable to load connection production: could not create new connection: sqlite3 support was not compiled into the binary Usage: buffalo test [flags] Flags: -h, --help help for test ERRO[0000] Error: could not find connection named test
Did I miss anything before running tests on this project? Someone please tell me. Thank you
The second line of output,
[pop] 2023/02/23 13:43:02 warn - <...>: sqlite3 support was not compiled into the binary
As you can see here, the root cause is that your buffalo
binary was not compiled to support sqlite3. How did you install it? If you use go install
, you should use the -tags sqlite
option, so the command should be
go install -tags sqlite github.com/gobuffalo/cli/cmd/buffalo@latest
See the documentation for more installation options.
The above is the detailed content of Go Buffalo test sqlite error: Connection named test not found. For more information, please follow other related articles on the PHP Chinese website!