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

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

#691 in Data structures

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.2–3MB
~55K SLoC