lib/cli/create_db: make WAL mode optional

This commit is contained in:
2025-05-16 17:05:59 +02:00
parent 4407c06f12
commit 42db69e57a
2 changed files with 15 additions and 1 deletions

View File

@@ -12,6 +12,16 @@ class CreateDb extends Command {
CreateDb() {
addLibsqliteArg(argParser);
argParser.addFlag(
'wal',
help:
'''Whether to use Write-Ahead Logging (WAL) mode.
This is recommended for better performance, but may not be used with
the readonly NixOS store.
''',
defaultsTo: false,
);
}
Future<void> run() async {
@@ -22,6 +32,7 @@ class CreateDb extends Command {
final db = await openLocalDb(
libsqlitePath: argResults!.option('libsqlite')!,
walMode: argResults!.flag('wal'),
readWrite: true,
);