@ultimat3/db 31.48.0 → 31.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ import type {
15
15
  TriggerRecord,
16
16
  ViewDescription,
17
17
  } from './introspect';
18
+ import { statementsOf } from './statement-split';
18
19
 
19
20
  const str = (value: unknown): value is string => typeof value === 'string';
20
21
  const bool = (value: unknown): value is boolean => typeof value === 'boolean';
@@ -47,6 +48,10 @@ function column(value: unknown): ColumnDescription | undefined {
47
48
  } = value;
48
49
  if (!str(name) || !str(dataType) || !bool(nullable) || !nullableStr(fallback)) return undefined;
49
50
  if (typeof position !== 'number') return undefined;
51
+ // Spliced into `down` by every arm that puts a column back (`add column "x" <dataType>`), from a
52
+ // file anything may edit: one statement, the screen a recorded default and a generation
53
+ // expression take where they are spliced. Here, not there, because there are five such arms.
54
+ if (statementsOf(dataType).length > 1) return undefined;
50
55
  // `generated` was recorded by `snapshotOf` and dropped HERE, silently, for as long as the field
51
56
  // has existed: the sidecar carried the expression and the parse handed back a column without it,
52
57
  // so `retypeColumn` read every generated column as newly generated and rebuilt it on every