I have found these related issues/pull requests
No prior discussion that I could find.
Description
In a larger application it's common to break it up into multiple crates, which may involve different crates using sqlx for different parts of the database. These crates may share a lot of common configuration, such as preferred-crates or type-overrides.
Currently it appears to be possible to have a fully shared configuration via symlinking, which I do think satisfies my usecase for now, but could maybe be mentioned in the docs. That also handles publishing outside the workspace correctly: the symlink gets turned into a file copy in the tarball by cargo package. But it seems likely that there are cases where you want to share some but not all config, such as the different-DATABASE_URL cases but where you might expect all databases to be running a set of extensions. For an unpublished application that is designed to only compile as part of the workspace as a whole it would be possible for it to rely on reading files outside the CARGO_MANIFEST_DIR.
Prefered solution
Probably some explicit opt-in in the per-crate sqlx.toml telling it to read ../sqlx.toml that makes it clear this is slightly outside the bounds of what Cargo truly supports and will only work when building from the repository.
Is this a breaking change? Why or why not?
No, it would be a new functionality.
I have found these related issues/pull requests
No prior discussion that I could find.
Description
In a larger application it's common to break it up into multiple crates, which may involve different crates using sqlx for different parts of the database. These crates may share a lot of common configuration, such as preferred-crates or type-overrides.
Currently it appears to be possible to have a fully shared configuration via symlinking, which I do think satisfies my usecase for now, but could maybe be mentioned in the docs. That also handles publishing outside the workspace correctly: the symlink gets turned into a file copy in the tarball by
cargo package. But it seems likely that there are cases where you want to share some but not all config, such as the different-DATABASE_URL cases but where you might expect all databases to be running a set of extensions. For an unpublished application that is designed to only compile as part of the workspace as a whole it would be possible for it to rely on reading files outside theCARGO_MANIFEST_DIR.Prefered solution
Probably some explicit opt-in in the per-crate
sqlx.tomltelling it to read../sqlx.tomlthat makes it clear this is slightly outside the bounds of what Cargo truly supports and will only work when building from the repository.Is this a breaking change? Why or why not?
No, it would be a new functionality.