Skip to content

Commit 0d1e0f0

Browse files
committed
refactor: rename busyTimeoutMilliseconds to busyTimeoutMs and simplify native config
1 parent 0ea6986 commit 0d1e0f0

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/data/app_database/lib/src/connection/native.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DatabaseConnection createAppDatabaseConnection(
99
String name, {
1010
bool logStatements = false,
1111
bool isWalEnabled = true,
12-
int? busyTimeoutMilliseconds = 5000,
12+
int busyTimeoutMs = 5000,
1313
}) {
1414
return DatabaseConnection.delayed(
1515
Future.sync(() async {
@@ -26,8 +26,8 @@ DatabaseConnection createAppDatabaseConnection(
2626
}
2727

2828
// Sets a timeout (in milliseconds) for waiting when the database is locked.
29-
if (busyTimeoutMilliseconds != null) {
30-
database.execute('PRAGMA busy_timeout=$busyTimeoutMilliseconds;');
29+
if (busyTimeoutMs >= 0) {
30+
database.execute('PRAGMA busy_timeout=$busyTimeoutMs;');
3131
}
3232
},
3333
);

packages/data/app_database/lib/src/connection/unsupported.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DatabaseConnection createAppDatabaseConnection(
55
String name, {
66
bool logStatements = false,
77
bool isWalEnabled = true,
8-
int? busyTimeoutMilliseconds = 5000,
8+
int? busyTimeoutMs = 5000,
99
}) {
1010
throw UnsupportedError('No suitable database connection implementation was found on this platform.');
1111
}

packages/data/app_database/lib/src/connection/web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DatabaseConnection createAppDatabaseConnection(
1010
bool isWalEnabled = true,
1111

1212
/// Ignored on Web; provided for API compatibility with native platforms.
13-
int? busyTimeoutMilliseconds = 5000,
13+
int? busyTimeoutMs = 5000,
1414
}) {
1515
assert(path == null || path.isEmpty, 'path is not supported on web');
1616

0 commit comments

Comments
 (0)