You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 48e67e5
Browse filesBrowse the repository at this point in the historyBrowse files
fix: report misconfigured Recall write connections and skip unseen views
An unknown write connection, a non-string adapter, a SQLite connection without a path, an empty ClickHouse database or an unterminated environment reference now fails the command with C975, like a write connection without a read connection; an unset environment variable still only skips recording. A ClickHouse writer that sees none of the views, as when granted only the tables, issues no view DDL, warns of no view upgrade and records no version it cannot vouch for. A test checks that both dialects' views expose the same columns.
Copy file name to clipboardExpand all lines: crates/sqlbuild-recall/src/schema/main/schema_age.rs
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,16 @@ use std::collections::{BTreeMap, BTreeSet};
4
4
5
5
usecrate::schema::models::SchemaAge;
6
6
7
-
/// Compare the `observed` columns of each table and view with this build's `expected` ones; both evolve additively, so a missing relation or column means an older store and an unknown column a newer one. A relation this build does not define is ignored.
7
+
/// Compare the `observed` columns of each table and view with this build's `expected` ones; both evolve additively, so a missing relation or column means an older store and an unknown column a newer one. When none of `views` is observed, the user may simply not see them, so nothing is judged. A relation this build does not define is ignored.
8
8
#[must_use]
9
9
pubfnschema_age(
10
10
expected:&BTreeMap<&'staticstr,BTreeSet<String>>,
11
11
observed:&BTreeMap<String,BTreeSet<String>>,
12
+
views:&[&str],
12
13
) -> SchemaAge{
14
+
if !views.iter().any(|view| observed.contains_key(*view)){
/// Upgrade an older store and record this build's version; never replace a newer store's views or record a lower version than it holds. A version row older than half the retention is appended again with the highest version seen, so retention never removes the last one.
6
+
/// Upgrade an older store and record this build's version; never replace a newer store's views or record a lower version than it holds. A version row older than half the retention is appended again with the highest version seen, so retention never removes the last one. A user who sees no view runs no view statements and, without a version row, records none.
0 commit comments