@@ -9,7 +9,6 @@ import Data.Either (Either(..))
99import Data.Foldable (foldl)
1010import Data.Map as Map
1111import Data.Maybe (Maybe(..))
12−import Data.Nullable (toNullable)
1312import Data.String.Regex as Regex
1413import Data.String.Regex.Flags as RegexFlags
1514import Data.Symbol (class IsSymbol, reflectSymbol)
@@ -486,22 +485,8 @@ else instance HasAnyDMLRL (RL.Cons "delete" Unit rest)
486485else instance HasAnyDMLRL rest => HasAnyDMLRL (RL.Cons label typ rest)
487486else instance Fail (Text "WHERE requires a preceding SELECT, UPDATE (set), or DELETE") => HasAnyDMLRL RL.Nil
488487
489−-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
490−-- FieldToCQLValue: convert a PureScript value to Foreign for CQL
491−-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
492−
493−class FieldToCQLValue :: Type -> Constraint
494−class FieldToCQLValue a where
495− fieldToCQLValue :: a -> Foreign
496−
497−instance FieldToCQLValue a => FieldToCQLValue (Maybe a) where
498− fieldToCQLValue = toNullable >>> unsafeCoerce
499−else instance FieldToCQLValue DateTime where
500− fieldToCQLValue = unsafeCoerce
501−else instance FieldToCQLValue Scylla.UUID where
502− fieldToCQLValue = unsafeCoerce
503−else instance FieldToCQLValue a where
504− fieldToCQLValue = unsafeCoerce
488+-- Values use the public Scylla.ToCQLValue extension point. Maybe must unwrap
489+-- through that instance so wrapped domain values keep their database encoding.
505490
506491-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
507492-- RecordValuesRL: walk a RowList and extract values from a record
@@ -517,12 +502,12 @@ instance RecordValuesRL RL.Nil row where
517502instance
518503 ( IsSymbol name
519504 , Row.Cons name typ rest row
520− , FieldToCQLValue typ
505+ , Scylla.ToCQLValue typ
521506 , RecordValuesRL tail row
522507 ) =>
523508 RecordValuesRL (RL.Cons name typ tail) row where
524509 recordValuesRL _ rec =
525− [ fieldToCQLValue (Record.get (Proxy :: Proxy name) rec) ]
510+ [ Scylla.toCQLValue (Record.get (Proxy :: Proxy name) rec) ]
526511 <> recordValuesRL (Proxy :: Proxy tail) rec
527512
528513-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -772,7 +757,8 @@ else instance
772757class ResolveParamType :: Symbol -> RL.RowList Type -> Type -> Constraint
773758class ResolveParamType name rl typ | name rl -> typ
774759
775−instance (ExtractType entry typ) => ResolveParamType name (RL.Cons name entry tail) typ
760+instance Fail (Text "Column not found in table") => ResolveParamType name RL.Nil typ
761+else instance (ExtractType entry typ) => ResolveParamType name (RL.Cons name entry tail) typ
776762else instance ResolveParamType name tail typ => ResolveParamType name (RL.Cons other entry tail) typ
777763
778764-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━