mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
error: cannot find type Connection in this scope
#320
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kushwahashiv on GitHub (Jun 15, 2019).
Environment
VScode: latest
OS: Macbook Pro 64bit
error:
cannot find type
Connectionin this scopenot found in this scope
is there anything I'm missing above?
@dani-garcia commented on GitHub (Jun 15, 2019):
You need to enable, either the
sqliteor themysqlfeature to compile the code.In vscode, create a
.vscodefolder in the project root and in asettings.jsonfile write the following:@kushwahashiv commented on GitHub (Jun 15, 2019):
@dani-garcia Thanks for the reply.
I am using
postgresinsettings.jsonas you mentioned above and FYI I'm usingpostgresinstead ofmysqlandsqllitebut seems still it can't resolve and gives the same error as above. seems none of features are being picked so it cannot findconnection.@dani-garcia commented on GitHub (Jun 15, 2019):
We don't support postgres at the moment, the only options are sqlite or mysql.
@kushwahashiv commented on GitHub (Jun 19, 2019):
Even it does not work for me for above both i.e. sqlite or mysql.
You just clone and open in vscode editor and you will get above error shown in the screenshot.
@dani-garcia commented on GitHub (Jun 21, 2019):
Yeah, you need to select either the sqlite or the mysql feature for the code to compile.
When editing from vscode you can use the config option I mentioned before and when using cargo you'll have to append
--features "sqlite"for the project to build.You could also edit
cargo.tomland adddefault = ["sqlite"]directly under the[features]key, and that will work for both the editor and cargo.Note that you can't select both, it has to be either
sqliteormysql.@kushwahashiv commented on GitHub (Jun 21, 2019):
Thanks @dani-garcia. Yes, that works now.