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
49
50
51
52
53
//! # Query Module
//!
//! This module provides the querying capabilities for the image archival system,
//! allowing users to create and execute queries on images and tags based on
//! specified criteria. The module is divided into submodules for handling
//! image-specific and tag-specific queries.
//!
//! ## Components
//!
//! - **Image Queries**: Utilize the `ImageQuery`, `ImageQueryExpr`, and `ImageQueryKind`
//! types for constructing and executing complex queries on images, including logical
//! operations and filter conditions involving tags and metadata.
//!
//! - **Tag Queries**: Implemented via the `TagQuery`, `TagQueryExpr`, and `TagQueryKind`
//! types to facilitate searching and filtering tags through varied expressions and patterns.
//!
//! ## Usage
//!
//! The module allows you to build queries that can be converted into SQL expressions
//! and executed against a relational database. Image queries can include conditions
//! based on tags, logical expressions, and temporal constraints, while tag queries
//! support operations such as matching, prefix, and containment searches.
//!
//! ## Examples
//!
//! Creating an image query to retrieve images associated with specific tags and ordered by creation date:
//! ```rust
//! # use buru::query::ImageQuery;
//! # use buru::query::image::tag;
//! # use buru::query::OrderBy;
//! let query = ImageQuery::filter(tag("nature"))
//! .with_limit(10)
//! .with_offset(0)
//! .with_order(OrderBy::CreatedAtAsc);
//! let (sql, params) = query.to_sql();
//! ```
//!
//! Creating a tag query to find all tags starting with a specific prefix:
//! ```rust
//! # use buru::query::TagQuery;
//! # use buru::query::TagQueryKind;
//! # use buru::query::TagQueryExpr;
//! let query = TagQuery::new(TagQueryKind::Where(TagQueryExpr::Prefix("na".to_string())))
//! .with_limit(5)
//! .with_offset(0);
//! let (sql, params) = query.to_sql();
//! ```
pub use ;
pub use ;