1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Operator-based SQL generation system
//!
//! This module provides type-safe operator abstractions for building WHERE clauses,
//! ORDER BY clauses, and query modifiers (LIMIT/OFFSET) without raw SQL strings.
//!
//! # Design Philosophy
//!
//! fraiseql-wire maintains backward compatibility with the existing string-based API
//! while offering operator abstractions for type safety and auditability:
//!
//! ```text
//! // Requires: live Postgres connection via FraiseClient.
//! // Old style (still works)
//! client.query("users")
//! .where_sql("data->>'name' = 'John'")
//! .execute()
//! .await?;
//!
//! // New style (type-safe)
//! client.query("users")
//! .where_operator(WhereOperator::Eq(
//! Field::JsonbField("name".to_string()),
//! Value::String("John".to_string()),
//! ))
//! .execute()
//! .await?;
//! ```
//!
//! # Operator Coverage
//!
//! - **Comparison**: Eq, Neq, Gt, Gte, Lt, Lte
//! - **Array**: In, Nin, Contains, `ArrayContains`, `ArrayContainedBy`, `ArrayOverlaps`
//! - **Array Length**: `LenEq`, `LenGt`, `LenGte`, `LenLt`, `LenLte`
//! - **String**: Contains, Icontains, Startswith, Endswith, Like, Ilike
//! - **Null**: `IsNull`
//! - **Vector Distance**: `L2Distance`, `CosineDistance`, `InnerProduct`, `JaccardDistance`
//! - **Full-Text Search**: Matches, `PlainQuery`, `PhraseQuery`, `WebsearchQuery`
//! - **Network**: `IsIPv4`, `IsIPv6`, `IsPrivate`, `IsLoopback`, `InSubnet`, `ContainsSubnet`, `ContainsIP`, `IPRangeOverlap`
pub use ;
pub use ;
pub use generate_where_operator_sql;
pub use WhereOperator;