error: cannot find type Connection in this scope #320

Closed
opened 2026-02-04 19:33:41 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @kushwahashiv on GitHub (Jun 15, 2019).

Environment
VScode: latest
OS: Macbook Pro 64bit

error:
cannot find type Connection in this scope
not found in this scope

image

is there anything I'm missing above?

Originally created by @kushwahashiv on GitHub (Jun 15, 2019). Environment VScode: latest OS: Macbook Pro 64bit error: cannot find type `Connection` in this scope not found in this scope ![image](https://user-images.githubusercontent.com/4386810/59543162-5d320380-8ebe-11e9-8475-0f1e0fdd4c36.png) is there anything I'm missing above?
Author
Owner

@dani-garcia commented on GitHub (Jun 15, 2019):

You need to enable, either the sqlite or the mysql feature to compile the code.

In vscode, create a .vscode folder in the project root and in a settings.json file write the following:

{
    "rust.features": ["sqlite"],
}
@dani-garcia commented on GitHub (Jun 15, 2019): You need to enable, either the `sqlite` or the `mysql` feature to compile the code. In vscode, create a `.vscode` folder in the project root and in a `settings.json` file write the following: ```json { "rust.features": ["sqlite"], } ```
Author
Owner

@kushwahashiv commented on GitHub (Jun 15, 2019):

@dani-garcia Thanks for the reply.
I am using postgres in settings.json as you mentioned above and FYI I'm using postgres instead of mysql and sqllite but seems still it can't resolve and gives the same error as above. seems none of features are being picked so it cannot find connection.

@kushwahashiv commented on GitHub (Jun 15, 2019): @dani-garcia Thanks for the reply. I am using `postgres` in `settings.json` as you mentioned above and FYI I'm using `postgres` instead of `mysql` and `sqllite` but seems still it can't resolve and gives the same error as above. seems none of features are being picked so it cannot find `connection`.
Author
Owner

@dani-garcia commented on GitHub (Jun 15, 2019):

We don't support postgres at the moment, the only options are sqlite or mysql.

@dani-garcia commented on GitHub (Jun 15, 2019): We don't support postgres at the moment, the only options are sqlite or mysql.
Author
Owner

@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.

@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.
Author
Owner

@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.toml and add default = ["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 sqlite or mysql.

@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.toml` and add `default = ["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 `sqlite` or `mysql`.
Author
Owner

@kushwahashiv commented on GitHub (Jun 21, 2019):

Thanks @dani-garcia. Yes, that works now.

@kushwahashiv commented on GitHub (Jun 21, 2019): Thanks @dani-garcia. Yes, that works now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#320