@@ -284,7 +284,10 @@ final class QueryViewModel {
284284 resultsTruncated = false
285285 }
286286
287− func setDefaultQuery(stream: String, previousStream: String? = nil) {
287+ /// Sets the default query for the given stream, returning `true` if the
288+ /// query text was replaced (i.e. the user hadn't customized it).
289+ @discardableResult
290+ func setDefaultQuery(stream: String, previousStream: String? = nil) -> Bool {
288291 // Replace the query if it's empty or still matches the auto-generated
289292 // default for the previous stream. If the user edited the SQL, keep it.
290293 let shouldReplace: Bool
@@ -300,6 +303,7 @@ final class QueryViewModel {
300303 if shouldReplace {
301304 sqlQuery = "SELECT * FROM \(Self.escapeSQLIdentifier(stream)) ORDER BY p_timestamp DESC LIMIT \(queryLimit)"
302305 }
306+ return shouldReplace
303307 }
304308
305309 /// Escapes a SQL identifier by doubling internal double-quotes, then wrapping in double-quotes.