The `database` feature doesn't compile without a database driver feature
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with the reported dispatch matches in laravel-rust-database-0.2.0/src/db/neutral/transaction.rs:91 and src/db/neutral.rs:247, then check the type inference error at src/db/neutral.rs:293. Reproduce with database enabled and no driver feature. Done when that configuration compiles or produces a clear compile-time error explaining the driver requirement.
Written by the indexing model from the issue text.
Description
Enabling laravel-rust's database feature without one of database-sqlite, database-postgres or database-mysql fails to compile. This hits packages that forward a plain database feature (so apps can pick their own driver), and any cargo doc --all-features or MSRV check that doesn't pull in a driver.
Reproduction
[package]
name = "repro"
version = "0.1.0"
edition = "2024"
[dependencies]
laravel-rust = { version = "=0.2.0", default-features = false, features = ["database"] }
fn main() {}
cargo check (rustc 1.100.0):
error[E0004]: non-exhaustive patterns: type `&mut AnyTransaction<'_>` is non-empty
--> laravel-rust-database-0.2.0/src/db/neutral/transaction.rs:91:19
|
91 | dispatch!(self, AnyTransaction, tx => tx.begin().await.map(Into::into))
| ^^^^
= note: references are always considered inhabited
error[E0004]: non-exhaustive patterns: type `&AnyConnection` is non-empty
--> laravel-rust-database-0.2.0/src/db/neutral.rs:247:19
error[E0283]: type annotations needed for `(u32, _)`
--> laravel-rust-database-0.2.0/src/db/neutral.rs:293:13
With no driver enabled, AnyConnection and AnyTransaction have no variants, so the dispatch! matches are non-exhaustive.
Expected
Either database compiles on its own (for example, with an uninhabited fallback arm or a compile_error! that names the missing driver feature), or the docs say that database needs a driver feature.
Seen on 0.2.0; the same code is on 0.x at 6156f0e.
- Dominant language
- Rust
- Stars
- 847
- Forks
- 174
- Avg merge
- 5h 40m
- Merged PRs (30d)
- 167
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from laravel/rust-framework
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
laravel/rust-framework#864 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
laravel/rust-framework#876 ·
Maintainers usually reply within 1 day
-
Case-sensitive contains, starts_with and ends_with that match % and _ literally on every databaseOpen
Difficulty 4/5 3-5 days Newbie friendliness 58/100
laravel/rust-framework#874 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
laravel/rust-framework#873 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
laravel/rust-framework#872 ·
Maintainers usually reply within 1 day
All issues in laravel/rust-framework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
neuralmagic/crucible#579 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
eclipse-score/kyron#249 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
seanmonstar/reqwest#3157 ·
Maintainers usually reply within 2 days