7 个版本

0.3.1 2022年3月16日
0.3.0 2021年9月24日
0.2.1 2021年9月22日
0.1.2 2021年6月16日
0.1.1 2020年8月16日

#1015数据库接口

Download history · Rust 包仓库 657/week @ 2024-04-23 · Rust 包仓库 447/week @ 2024-04-30 · Rust 包仓库 373/week @ 2024-05-07 · Rust 包仓库 471/week @ 2024-05-14 · Rust 包仓库 486/week @ 2024-05-21 · Rust 包仓库 480/week @ 2024-05-28 · Rust 包仓库 522/week @ 2024-06-04 · Rust 包仓库 606/week @ 2024-06-11 · Rust 包仓库 660/week @ 2024-06-18 · Rust 包仓库 612/week @ 2024-06-25 · Rust 包仓库 473/week @ 2024-07-02 · Rust 包仓库 471/week @ 2024-07-09 · Rust 包仓库 488/week @ 2024-07-16 · Rust 包仓库 516/week @ 2024-07-23 · Rust 包仓库 770/week @ 2024-07-30 · Rust 包仓库 514/week @ 2024-08-06 · Rust 包仓库

2,330 每月下载量

Apache-2.0

34KB
678

like

Apache-2.0 licensed Crate API

SQL like 样式模式匹配。

用法

要进行模式匹配,使用 Like

use like::Like;

// Has Escape
assert!(Like::<true>::like("Hello, world!", "Hello%").unwrap());
// No Escape
assert!(Like::<false>::like("Hello, world!", "Hello%").unwrap());

要进行不区分大小写的模式匹配,使用 ILike

use like::ILike;

// Has Escape
assert!(ILike::<true>::ilike("Hello, world!", "HELLO%").unwrap());
// No Escape
assert!(ILike::<false>::ilike("Hello, world!", "HELLO%").unwrap());

要将模式转换为使用标准反斜杠转义约定,使用 Escape

use like::Escape;

assert_eq!("Hello$%".escape("$").unwrap(), "Hello\\%");

Rust 版本

此版本的 like 需要 Rust 1.57 或更高版本。

许可证

本项目采用 Apache-2.0 许可证(LICENSEhttps://apache.ac.cn/licenses/LICENSE-2.0)。

贡献

除非你明确表示,否则你提交的任何旨在包含在 like 中的贡献都应按 Apache-2.0 许可证许可,不附加任何额外条款或条件。

无运行时依赖