Skip to content

Commit ed002f8

Browse files
CLi: made cli-lib modules publicly available for other crates (#3881)
* change module visibility to public to easily integrate into other crates * update module documentation for SQLx CLI
1 parent c79ccb7 commit ed002f8

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

sqlx-cli/src/lib.rs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
//! # SQLx CLI
2+
//!
3+
//! Command-line utility for the [SQLx](https://github.com/launchbadge/sqlx) ecosystem.
4+
//!
5+
//! This crate provides the core logic for the `sqlx` command-line interface, enabling database management,
6+
//! migrations, and offline query preparation for Rust projects using SQLx.
7+
//!
8+
//! ### Note: Semver Exempt API
9+
//! The API of this crate is not meant for general use and does *not* follow Semantic Versioning.
10+
//! The only crate that follows Semantic Versioning in the project is the `sqlx` crate itself.
11+
//! If you are building a custom SQLx driver, you should pin an exact version for `sqlx-cli` to
12+
//! avoid breakages:
13+
//!
14+
//! ```toml
15+
//! sqlx-cli = { version = "=0.9.0" }
16+
//! ```
17+
//!
18+
//! And then make releases in lockstep with `sqlx-cli`. We recommend all driver crates, in-tree
19+
//! or otherwise, use the same version numbers as `sqlx-cli` to avoid confusion.
20+
121
use std::future::Future;
222
use std::io;
323
use std::time::Duration;
@@ -9,15 +29,15 @@ use tokio::{select, signal};
929

1030
use crate::opt::{Command, ConnectOpts, DatabaseCommand, MigrateCommand};
1131

12-
mod database;
13-
mod metadata;
32+
pub mod database;
33+
pub mod metadata;
1434
// mod migration;
1535
// mod migrator;
1636
#[cfg(feature = "completions")]
17-
mod completions;
18-
mod migrate;
19-
mod opt;
20-
mod prepare;
37+
pub mod completions;
38+
pub mod migrate;
39+
pub mod opt;
40+
pub mod prepare;
2141

2242
pub use crate::opt::Opt;
2343

0 commit comments

Comments
 (0)