Skip to content

CLi: made cli-lib modules publicly available for other crates #3881

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

silvestrpredko
Copy link

Made modules database, metadata, ... publicly available for users that want to include sqlx-cli into their own helper binary or other library. (It's easier to use migrate::run directly without building Opt).

PR doesn't contain any significant changes.

@abonander
Copy link
Collaborator

sqlx-cli is not meant to be used as a library. I don't want to have to think of downstream API users when making changes to it.

@silvestrpredko
Copy link
Author

sqlx-cli is not meant to be used as a library. I don't want to have to think of downstream API users when making changes to it.

There is nothing wrong with opening these modules; even if there will be breaking changes, it's not a problem for the project, I think.

For now, I want to have a custom behaviour for certain operations with migration revert, and I need to write all the logic for the rest of the CLI by myself, or build a whole Opt.

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs the same semver-exempt notice as sqlx-core:

//! ### Note: Semver Exempt API
//! The API of this crate is not meant for general use and does *not* follow Semantic Versioning.
//! The only crate that follows Semantic Versioning in the project is the `sqlx` crate itself.
//! If you are building a custom SQLx driver, you should pin an exact version for `sqlx-core` to
//! avoid breakages:
//!
//! ```toml
//! sqlx-core = { version = "=0.6.2" }
//! ```
//!
//! And then make releases in lockstep with `sqlx-core`. We recommend all driver crates, in-tree
//! or otherwise, use the same version numbers as `sqlx-core` to avoid confusion.

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

Successfully merging this pull request may close these issues.

2 participants