git.iko.soy/typeable/postgresql-simple
on master help sign in
Fix bug in Values syntax generation
commit5649f3800a206568bf9e817b889687e79be340be authorLeon P Smith <leon@melding-monads.com> dateMon 24 Mar 2014, 16:43 (13 years ago) parent4bc42c5
1 file changed+10−8
src/Database/PostgreSQL/Simple/ToField.hs+10−8
src/Database/PostgreSQL/Simple/ToField.hs+10−8
@@ -338,14 +338,16 @@ instance ToRow a => ToField (Values a) where
338338 typedRows :: ToRow a => [a] -> [QualifiedIdentifier] -> [Action] -> [Action]
339339 typedRows [] _ _ = error funcname
340340 typedRows (val:vals) types rest =
341− typedRow (toRow val) types (litC ',' : untypedRows vals rest)
341+ typedRow (toRow val) types (multiRows vals rest)
342342
343343 untypedRows :: ToRow a => [a] -> [Action] -> [Action]
344− untypedRows [] rest = rest
344+ untypedRows [] _ = error funcname
345345 untypedRows (val:vals) rest =
346− untypedRow (toRow val) $
347− interleaveFoldr
348− (untypedRow . toRow)
349− (litC ',')
350− rest
351− vals
346+ untypedRow (toRow val) (multiRows vals rest)
347+
348+ multiRows :: ToRow a => [a] -> [Action] -> [Action]
349+ multiRows vals rest = interleaveFoldr
350+ (untypedRow . toRow)
351+ (litC ',')
352+ rest
353+ vals