Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b0fb6bd27 |
@@ -79,8 +79,7 @@ ON CONFLICT (path) DO UPDATE SET
|
|||||||
content = excluded.content
|
content = excluded.content
|
||||||
`
|
`
|
||||||
|
|
||||||
// errNoDatabase reports a missing database file for report, trees and
|
// errNoDatabase reports a missing database file for report/trees.
|
||||||
// info.
|
|
||||||
var errNoDatabase = errors.New(
|
var errNoDatabase = errors.New(
|
||||||
"no database (run \"sfdupes scan\" first, or set " + databaseEnv + ")")
|
"no database (run \"sfdupes scan\" first, or set " + databaseEnv + ")")
|
||||||
|
|
||||||
@@ -132,9 +131,9 @@ const scanParams = "_pragma=busy_timeout(10000)" +
|
|||||||
"&_pragma=journal_mode(WAL)" +
|
"&_pragma=journal_mode(WAL)" +
|
||||||
"&_pragma=synchronous(NORMAL)"
|
"&_pragma=synchronous(NORMAL)"
|
||||||
|
|
||||||
// reportParams are the connection parameters for report, trees and
|
// reportParams are the connection parameters for report and trees:
|
||||||
// info: read-only, with the same busy timeout. They set no journal
|
// read-only, with the same busy timeout. They set no journal mode,
|
||||||
// mode, because setting one is a write.
|
// because setting one is a write.
|
||||||
const reportParams = "mode=ro" +
|
const reportParams = "mode=ro" +
|
||||||
"&_pragma=busy_timeout(10000)" +
|
"&_pragma=busy_timeout(10000)" +
|
||||||
"&_pragma=query_only(1)"
|
"&_pragma=query_only(1)"
|
||||||
@@ -263,9 +262,9 @@ func closeScanDatabase(ctx context.Context, db *sql.DB, path string) {
|
|||||||
_ = db.Close()
|
_ = db.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// openReportDatabase opens an existing database for the report, trees
|
// openReportDatabase opens an existing database for the report and
|
||||||
// and info subcommands. A missing database file is an error directing
|
// trees subcommands. A missing database file is an error directing the
|
||||||
// the user to run scan first; the schema version must match exactly.
|
// user to run scan first; the schema version must match exactly.
|
||||||
func openReportDatabase(ctx context.Context,
|
func openReportDatabase(ctx context.Context,
|
||||||
path string,
|
path string,
|
||||||
) (*sql.DB, error) {
|
) (*sql.DB, error) {
|
||||||
|
|||||||
Reference in new issue
Block a user