diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index fcbefdd..56c3244 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -339,7 +339,7 @@ rawSelectSource mode query = src run conn = uncurry withStmt $ - first (TL.toStrict . TLB.toLazyText) $ + first builderToText $ toRawSql mode (fromDBName conn) query massage = do @@ -451,7 +451,7 @@ rawExecute :: ( MonadLogger m rawExecute mode query = do conn <- SqlPersist R.ask uncurry execute $ - first (TL.toStrict . TLB.toLazyText) $ + first builderToText $ toRawSql mode (fromDBName conn) query @@ -508,6 +508,12 @@ update = rawExecute UPDATE . from ---------------------------------------------------------------------- +builderToText :: TLB.Builder -> T.Text +builderToText = TL.toStrict . TLB.toLazyTextWith defaultChunkSize + where + defaultChunkSize = 1024 - 32 + + -- | (Internal) Pretty prints a 'SqlQuery' into a SQL query. -- -- Note: if you're curious about the SQL query being generated by