From 3b190ba1e3af5dc5ba16aa027a6ca1dc652dc8c8 Mon Sep 17 00:00:00 2001 From: Silvestr Predko Date: Tue, 3 Jun 2025 17:24:31 +0300 Subject: [PATCH 1/2] change module visibility to public to easily integrate into other crates --- sqlx-cli/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sqlx-cli/src/lib.rs b/sqlx-cli/src/lib.rs index cb31205b4f..3e617793f0 100644 --- a/sqlx-cli/src/lib.rs +++ b/sqlx-cli/src/lib.rs @@ -9,15 +9,15 @@ use tokio::{select, signal}; use crate::opt::{Command, ConnectOpts, DatabaseCommand, MigrateCommand}; -mod database; -mod metadata; +pub mod database; +pub mod metadata; // mod migration; // mod migrator; #[cfg(feature = "completions")] -mod completions; -mod migrate; -mod opt; -mod prepare; +pub mod completions; +pub mod migrate; +pub mod opt; +pub mod prepare; pub use crate::opt::Opt; From 15fc6e0299e47aeb40dd34f8fe92a0cc59038a18 Mon Sep 17 00:00:00 2001 From: Silvestr Predko Date: Wed, 9 Jul 2025 21:31:35 +0300 Subject: [PATCH 2/2] update module documentation for SQLx CLI --- sqlx-cli/src/lib.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sqlx-cli/src/lib.rs b/sqlx-cli/src/lib.rs index 55180177a8..a69f7c2c53 100644 --- a/sqlx-cli/src/lib.rs +++ b/sqlx-cli/src/lib.rs @@ -1,3 +1,23 @@ +//! # SQLx CLI +//! +//! Command-line utility for the [SQLx](https://github.com/launchbadge/sqlx) ecosystem. +//! +//! This crate provides the core logic for the `sqlx` command-line interface, enabling database management, +//! migrations, and offline query preparation for Rust projects using SQLx. +//! +//! ### 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-cli` to +//! avoid breakages: +//! +//! ```toml +//! sqlx-cli = { version = "=0.9.0" } +//! ``` +//! +//! And then make releases in lockstep with `sqlx-cli`. We recommend all driver crates, in-tree +//! or otherwise, use the same version numbers as `sqlx-cli` to avoid confusion. + use std::future::Future; use std::io; use std::time::Duration;