Skip to content

Commit 75e462e

Browse files
committed
fix(core): require a SQL backend feature
1 parent d8117f3 commit 75e462e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎canyon_core/src/lib.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
//! and data mapping. It includes support for multiple database backends such as PostgreSQL,
55
//! MySQL, and SQL Server, and defines traits and utilities for interacting with these databases.
66
7+
#[cfg(not(any(feature = "postgres", feature = "mysql", feature = "mssql")))]
8+
compile_error!(
9+
"Canyon-SQL requires at least one SQL backend feature: `postgres`, `mysql` or `mssql`."
10+
);
11+
712
#[cfg(feature = "postgres")]
813
pub extern crate tokio_postgres;
914

@@ -17,12 +22,20 @@ pub extern crate mysql_async;
1722

1823
extern crate core;
1924

25+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2026
pub mod canyon;
2127

28+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2229
pub mod column;
30+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2331
pub mod connection;
32+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2433
pub mod mapper;
34+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2535
pub mod query;
36+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2637
pub mod row;
38+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2739
pub mod rows;
40+
#[cfg(any(feature = "postgres", feature = "mysql", feature = "mssql"))]
2841
pub mod transaction;

0 commit comments

Comments
 (0)