Skip to content

Commit

Permalink
Remove Feature Flag For Postgres Full Text Search Data Types #729,#2705
Browse files Browse the repository at this point in the history
  • Loading branch information
anshap1719 committed Feb 1, 2024
1 parent ffe29a8 commit dcec1dd
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 24 deletions.
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ features = ["all-databases", "_unstable-all-types"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["any", "macros", "migrate", "json", "full_text_search"]
default = ["any", "macros", "migrate", "json"]
macros = ["sqlx-macros"]
migrate = ["sqlx-core/migrate", "sqlx-macros?/migrate", "sqlx-mysql?/migrate", "sqlx-postgres?/migrate", "sqlx-sqlite?/migrate"]

Expand All @@ -67,8 +67,7 @@ _unstable-all-types = [
"ipnetwork",
"mac_address",
"uuid",
"bit-vec",
"full_text_search"
"bit-vec"
]

# Base runtime features without TLS
Expand Down Expand Up @@ -112,7 +111,6 @@ rust_decimal = ["sqlx-core/rust_decimal", "sqlx-macros?/rust_decimal", "sqlx-mys
time = ["sqlx-core/time", "sqlx-macros?/time", "sqlx-mysql?/time", "sqlx-postgres?/time", "sqlx-sqlite?/time"]
uuid = ["sqlx-core/uuid", "sqlx-macros?/uuid", "sqlx-mysql?/uuid", "sqlx-postgres?/uuid", "sqlx-sqlite?/uuid"]
regexp = ["sqlx-sqlite?/regexp"]
full_text_search = ["sqlx-core/full_text_search", "sqlx-macros?/full_text_search", "sqlx-postgres?/full_text_search"]

[workspace.dependencies]
# Core Crates
Expand Down Expand Up @@ -152,7 +150,7 @@ features = ["time", "net", "sync", "fs", "io-util", "rt"]
default-features = false

[dependencies]
sqlx-core = { workspace = true, features = ["offline", "migrate", "full_text_search"] }
sqlx-core = { workspace = true, features = ["offline", "migrate"] }
sqlx-macros = { workspace = true, optional = true }

sqlx-mysql = { workspace = true, optional = true }
Expand Down
2 changes: 0 additions & 2 deletions sqlx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ any = []

json = ["serde", "serde_json"]

full_text_search = []

# for conditional compilation
_rt-async-std = ["async-std", "async-io"]
_rt-tokio = ["tokio", "tokio-stream"]
Expand Down
1 change: 0 additions & 1 deletion sqlx-macros-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ mac_address = ["sqlx-core/mac_address", "sqlx-postgres?/mac_address"]
rust_decimal = ["sqlx-core/rust_decimal", "sqlx-mysql?/rust_decimal", "sqlx-postgres?/rust_decimal"]
time = ["sqlx-core/time", "sqlx-mysql?/time", "sqlx-postgres?/time", "sqlx-sqlite?/time"]
uuid = ["sqlx-core/uuid", "sqlx-mysql?/uuid", "sqlx-postgres?/uuid", "sqlx-sqlite?/uuid"]
full_text_search = ["sqlx-core/full_text_search", "sqlx-postgres?/full_text_search"]

[dependencies]
sqlx-core = { workspace = true, features = ["offline"] }
Expand Down
6 changes: 0 additions & 6 deletions sqlx-macros-core/src/database/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,10 @@ impl_database_ext! {
&[sqlx::postgres::types::PgRange<sqlx::types::time::OffsetDateTime>],

// Full text search
#[cfg(feature = "full_text_search")]
sqlx::postgres::types::TsVector,

#[cfg(feature = "full_text_search")]
Vec<sqlx::postgres::types::TsVector> | &[sqlx::postgres::types::TsVector],

#[cfg(feature = "full_text_search")]
sqlx::postgres::types::TsQuery,

#[cfg(feature = "full_text_search")]
Vec<sqlx::postgres::types::TsQuery> | &[sqlx::postgres::types::TsQuery],
},
ParamChecking::Strong,
Expand Down
1 change: 0 additions & 1 deletion sqlx-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ rust_decimal = ["sqlx-macros-core/rust_decimal"]
time = ["sqlx-macros-core/time"]
uuid = ["sqlx-macros-core/uuid"]
json = ["sqlx-macros-core/json"]
full_text_search = ["sqlx-macros-core/full_text_search"]

[dependencies]
sqlx-core = { workspace = true, features = ["any"] }
Expand Down
3 changes: 1 addition & 2 deletions sqlx-postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ any = ["sqlx-core/any"]
json = ["sqlx-core/json"]
migrate = ["sqlx-core/migrate"]
offline = ["sqlx-core/offline"]
full_text_search = ["sqlx-core/full_text_search"]

# Type integration features which require additional dependencies
rust_decimal = ["dep:rust_decimal", "rust_decimal/maths"]
Expand Down Expand Up @@ -71,7 +70,7 @@ serde_json = { version = "1.0.85", features = ["raw_value"] }
[dependencies.sqlx-core]
workspace = true
# We use JSON in the driver implementation itself so there's no reason not to enable it here.
features = ["json", "full_text_search"]
features = ["json"]

[target.'cfg(target_os = "windows")'.dependencies]
etcetera = "0.8.0"
7 changes: 1 addition & 6 deletions sqlx-postgres/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ mod mac_address;
#[cfg(feature = "bit-vec")]
mod bit_vec;

#[cfg(feature = "full_text_search")]
mod ts_query;
#[cfg(feature = "full_text_search")]
mod ts_vector;

pub use array::PgHasArrayType;
Expand All @@ -252,11 +250,8 @@ pub use range::PgRange;
#[cfg(any(feature = "chrono", feature = "time"))]
pub use time_tz::PgTimeTz;

#[cfg(feature = "full_text_search")]
pub use ts_vector::TsVector;

#[cfg(feature = "full_text_search")]
pub use ts_query::TsQuery;
pub use ts_vector::TsVector;

// used in derive(Type) for `struct`
// but the interface is not considered part of the public API
Expand Down
1 change: 0 additions & 1 deletion tests/postgres/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ mod json {
}
}

#[cfg(feature = "full_text_search")]
mod full_text_search {
use super::*;
use sqlx::postgres::types::TsVector;
Expand Down

0 comments on commit dcec1dd

Please sign in to comment.