patchworks 0.3.0

Git-style visual diffs for SQLite databases. Inspect, compare, snapshot, and generate SQL migrations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Small wrappers around native dialogs.

use std::path::PathBuf;

/// Opens a native file dialog filtered to common SQLite extensions.
pub fn open_database_dialog() -> Option<PathBuf> {
    rfd::FileDialog::new()
        .add_filter("SQLite Database", &["db", "sqlite", "sqlite3"])
        .pick_file()
}

/// Opens a native save dialog for SQL export files.
pub fn save_sql_dialog() -> Option<PathBuf> {
    rfd::FileDialog::new()
        .add_filter("SQL Script", &["sql"])
        .set_file_name("patchworks-diff.sql")
        .save_file()
}