mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
[offline] Use buffering for JSON file reading / writing
This commit is contained in:
committed by
Ryan Leckey
parent
ce56f191ec
commit
52a7c35439
@@ -5,6 +5,7 @@ use remove_dir_all::remove_dir_all;
|
||||
use sqlx::any::{AnyConnectOptions, AnyKind};
|
||||
use std::collections::BTreeMap;
|
||||
use std::fs::File;
|
||||
use std::io::BufWriter;
|
||||
use std::process::Command;
|
||||
use std::str::FromStr;
|
||||
use std::time::SystemTime;
|
||||
@@ -32,7 +33,9 @@ pub fn run(url: &str, merge: bool, cargo_args: Vec<String>) -> anyhow::Result<()
|
||||
}
|
||||
|
||||
serde_json::to_writer_pretty(
|
||||
File::create("sqlx-data.json").context("failed to create/open `sqlx-data.json`")?,
|
||||
BufWriter::new(
|
||||
File::create("sqlx-data.json").context("failed to create/open `sqlx-data.json`")?,
|
||||
),
|
||||
&DataFile { db: db_kind, data },
|
||||
)
|
||||
.context("failed to write to `sqlx-data.json`")?;
|
||||
|
||||
Reference in New Issue
Block a user