4 releases (breaking)

new 0.4.0 Mar 6, 2025
0.3.0 Jan 19, 2025
0.2.0 Aug 31, 2024
0.1.0 Aug 31, 2024

#1412 in Database interfaces

Download history 2/week @ 2024-12-08 103/week @ 2025-01-19 5/week @ 2025-02-02 1/week @ 2025-02-23 126/week @ 2025-03-02

128 downloads per month

MIT/Apache

15KB
211 lines

rusqlite_regex

Crate GitHub last commit GitHub issues GitHub pull requests GitHub

Description

A SQLite extension for regular expressions written in pure Rust. Based on rusqlite and regex.

Usage

Add this to your Cargo.toml:

[dependencies]
rusqlite_regex = "~0.3"

Example

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(())
}

Version map

This is the compatible version map between rusqlite_regex and rusqlite:

rusqlite_regex version rusqlite version
=0.4.0 ~0.34
=0.3.0 ~0.33
=0.2.0 ~0.32
=0.1.0 ~0.32

License

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.

Dependencies

~30MB
~475K SLoC