18 releases

new 0.5.0 Dec 8, 2025
0.4.2 Nov 12, 2025
0.4.0 Sep 16, 2025
0.3.7 May 19, 2025
0.3.1 Nov 14, 2024

#1488 in Database interfaces

Download history 109/week @ 2025-08-16 99/week @ 2025-08-23 101/week @ 2025-08-30 303/week @ 2025-09-06 279/week @ 2025-09-13 271/week @ 2025-09-20 80/week @ 2025-09-27 112/week @ 2025-10-04 100/week @ 2025-10-11 222/week @ 2025-10-18 41/week @ 2025-10-25 2/week @ 2025-11-01 285/week @ 2025-11-08 76/week @ 2025-11-15 208/week @ 2025-11-22 64/week @ 2025-11-29

633 downloads per month
Used in 11 crates (4 directly)

MIT license

165KB
2K SLoC

cql2-rs

CI

Parse, validate, and convert Common Query Language (CQL2) text and JSON.

Usage

API

[dependencies]
cql = "0.4"

Then:

use cql2::Expr;

let expr: Expr = "landsat:scene_id = 'LC82030282019133LGN00'".parse().unwrap();
assert!(expr.is_valid());
println!("{}", expr.to_json().unwrap());

See the documentation for more.

CLI

See the cql2-cli README for details.

Responses

Responses may not match the input.

cql2-text differences

  • All identifiers in output are double quoted
  • The position of "NOT" keywords is standardized to be before the expression (ie "... NOT LIKE ..." will become "NOT ... LIKE ..."
  • The negative operator on anything besides a literal number becomes "* -1"
  • Parentheses are added around all expressions

Development

Get uv and Rust. Then:

git clone git@github.com:developmentseed/cql2-rs.git
cd cql2-rs
uv sync
scripts/test

To lint all files:

scripts/lint

To serve the docs locally:

uv run mkdocs serve  # http://127.0.0.1:8000/cql2-rs/

See CONTRIBUTING.md for more information about contributing to this project.

License

cql2-rs is licensed under the MIT license. See LICENSE for details.

Dependencies

~37MB
~581K SLoC