File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ internal extension AttributeValue {
4646 return . double( value)
4747 case let . decimal( value) :
4848 return . text( value. description)
49+ case . composite:
50+ // A composite has no single binding: it is expanded into one binding per leaf
51+ // column by `ModelData.columnValues(for:)`. Reaching here means a composite was
52+ // used where a scalar is required, e.g. as a predicate constant.
53+ return nil
4954 }
5055 }
5156
@@ -116,6 +121,10 @@ internal extension AttributeValue {
116121 throw SQLiteDatabaseError . invalidBinding ( binding, type)
117122 }
118123 self = . decimal( value)
124+ case . composite:
125+ // Composites are reassembled from their leaf columns by
126+ // `AttributeValue.decode(attribute:row:)`, never from a single binding.
127+ throw SQLiteDatabaseError . invalidBinding ( binding, type)
119128 }
120129 }
121130}
You can’t perform that action at this time.
0 commit comments