#sql-query #similarity #sql #data-engineering #postgresql

magnetise

A Rust library to asses the similarity between SQL queries

3 releases

0.1.2 Sep 4, 2024
0.1.1 Sep 4, 2024
0.1.0 Sep 4, 2024

#648 in Data structures

Download history 280/week @ 2024-08-31 36/week @ 2024-09-07 49/week @ 2024-09-14 17/week @ 2024-09-21 9/week @ 2024-09-28

143 downloads per month

Apache-2.0

16KB

magnetise

Welcome to magnetise, a Rust library to asses the similarity between SQL queries.

Usage

fn main() {

    // Short length queries are cases with 
    // higher sensibility towards small differences.
    let query1 = "SELECT * FROM users WHERE age > 30";
    let query2 = "SELECT * FROM users WHERE age > 31";

    let similarity = jaccard_similarity(query1, query2);
    println!("Jaccard similarity: {}", similarity);

}

lib.rs:

A Rust library to asses the similarity between SQL queries.

Dependencies

~2.1–3MB
~54K SLoC