bit-twiddler 0.1.0

Cross-platform developer toolbox: bit manipulation, hashing, YAML/JSON/SQL, QR, Markdown, cron, and 40+ more tools — Tauri v2, no Node.js
1
2
3
4
5
6
7
8
9
10
11
12
use sqlformat::{format, FormatOptions, Indent, QueryParams};

#[tauri::command]
pub fn format_sql(sql: String, _language: String) -> Result<String, String> {
    let options = FormatOptions {
        indent: Indent::Spaces(2),
        uppercase: Some(true),
        lines_between_queries: 2,
        ..FormatOptions::default()
    };
    Ok(format(&sql, &QueryParams::None, &options))
}