minify_sql

Function minify_sql 

Source
pub fn minify_sql(document: &str) -> String
Expand description

Returns the provided SQL content minified.

§Arguments

  • path - A string slice that holds the path to the SQL file

§Examples

use minify_sql::minify_sql;

let minified: String = minify_sql(
    "-- Your SQL goes here
CREATE TABLE IF NOT EXISTS taxa (
    -- The unique identifier for the taxon
    id UUID PRIMARY KEY,
    -- The scientific name of the taxon
    name TEXT NOT NULL,
    -- The NCBI Taxon ID is a unique identifier for a taxon in the NCBI Taxonomy database
    -- which may be NULL when this taxon is not present in the NCBI Taxonomy database.
    ncbi_taxon_id INTEGER
);
",
);

assert_eq!(
    minified,
    "CREATE TABLE IF NOT EXISTS taxa(id UUID PRIMARY KEY,name TEXT NOT NULL,ncbi_taxon_id INT)"
);