| Crates.io | rusqlite_regex |
| lib.rs | rusqlite_regex |
| version | 0.6.0 |
| created_at | 2024-08-31 08:33:44.996214+00 |
| updated_at | 2025-05-27 16:05:12.256229+00 |
| description | A regex extension for rusqlite |
| homepage | |
| repository | https://github.com/xuxiaocheng0201/rusqlite_regex |
| max_upload_size | |
| id | 1358658 |
| size | 39,693 |
A SQLite extension for regular expressions written in pure Rust. Based on rusqlite and regex.
Add this to your Cargo.toml:
[dependencies]
rusqlite_regex = "~0.5"
fn main() -> Result<(), rusqlite::Error> {
rusqlite_regex::enable_auto_extension()?;
let conn = rusqlite::Connection::open_in_memory()?;
conn.execute_batch("
CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT);
INSERT INTO test (name) VALUES ('I categorically deny having triskaidekaphobia.');
")?;
assert_eq!(1,
conn.query_row(
"SELECT id FROM test WHERE name REGEXP '\\b\\w{13}\\b'",
[], |row| row.get::<_, i64>(0)
)?
);
Ok(())
}
This is the compatible version map between rusqlite_regex and rusqlite:
rusqlite_regex version |
rusqlite version |
|---|---|
| =0.6.0 | >=0.32,<1.0 |
| =0.5.0 | ~0.35 |
| =0.4.0 | ~0.34 |
| =0.3.0 | ~0.33 |
| =0.2.0 | ~0.32 |
| =0.1.0 | ~0.32 |
This project is licensed under either of
Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0) MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.