make moonfire-nvr sql enforce integrity

https://github.com/scottlamb/moonfire-nvr/issues/175#issuecomment-1008096087
This commit is contained in:
Scott Lamb
2022-01-08 10:49:50 -08:00
parent 0406e09ca4
commit 77775a82e5
2 changed files with 21 additions and 6 deletions

View File

@@ -52,6 +52,12 @@ pub fn run(args: Args) -> Result<i32, Error> {
db.push("?mode=ro");
}
Err(Command::new("sqlite3")
.args(
db::db::INTEGRITY_PRAGMAS
.iter()
.map(|p| ["-cmd", p])
.flatten(),
)
.arg(&db)
.args(&args.arg)
.exec()