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

Error: non-exhaustive patterns: &DatabaseConnection::SqlxMySqlPoolConnection(_) not covered #410

Closed
Borderliner opened this issue Feb 1, 2024 · 0 comments

Comments

@Borderliner
Copy link
Contributor

Description

Cannot build loco with sqlx-mysql, because apparently pattern &DatabaseConnection::SqlxMySqlPoolConnection(_) not covered in file src/db.rs which seems to be true.

To Reproduce

Use the following config for development:
uri: {{ get_env(name="DATABASE_URL", default="mysql://root@127.0.0.1:3306/smm_loco_dev") }}

Expected Behavior

Build successfully

Environment:

  • I'm on Linux Mint 21.3 which is based on Ubuntu 22.04 LTS so there's a minimum chance of incompatibility.
  • Using rustc 1.75.0 (82e1608df 2023-12-21)
  • Tried Loco v0.2.3 or v0.2.2
  • Using Devilbox docker container to access database on 127.0.0.1:3306 which works just fine.

Additional Context

error[E0004]: non-exhaustive patterns: `&DatabaseConnection::SqlxMySqlPoolConnection(_)` not covered
  --> /home/reza/.cargo/registry/src/index.crates.io-6f17d22bba15001f/loco-rs-0.2.3/src/db.rs:41:11
   |
41 |     match db {
   |           ^^ pattern `&DatabaseConnection::SqlxMySqlPoolConnection(_)` not covered
   |
note: `DatabaseConnection` defined here
  --> /home/reza/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-0.12.12/src/database/db_connection.rs:19:1
   |
19 | pub enum DatabaseConnection {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
22 |     SqlxMySqlPoolConnection(crate::SqlxMySqlPoolConnection),
   |     ----------------------- not covered
   = note: the matched value is of type `&DatabaseConnection`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
58 ~         },
59 +         &DatabaseConnection::SqlxMySqlPoolConnection(_) => todo!()
   |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `loco-rs` (lib) due to previous error
Borderliner added a commit to Borderliner/loco that referenced this issue Feb 1, 2024
Fix the issue loco-rs#410 where one could'nt use mysql for the driver because `DatabaseConnection` match case was not fully covered.
jondot added a commit that referenced this issue Feb 4, 2024
@jondot jondot closed this as completed Feb 4, 2024
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