on dev help sign in
comment out statement preparation

I’ll revisit statement preparation in v0.2

commit1e4cb98097bd01ccbf1cd702f7ff07055c3c3905 authorEitan Chatav <eitan.chatav@gmail.com> dateTue 18 Jul 2017, 11:36 (9 years ago) parent423d1e9
2 files changed+20−20
squeel-postgresql/src/Squeel/PostgreSQL/PQ.hs+13−13 squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+7−7
squeel-postgresql/src/Squeel/PostgreSQL/PQ.hs+13−13
@@ -114,11 +114,11 @@ class MonadPQ db m | m -> db where
114114 -> m (Maybe (Result ys))
115115 pqExecNil statement = pqExecParams statement Nil
116116
117− pqExecPrepared
118− :: AllZip HasEncoding ps xs
119− => PreparedStatement ps ys db db
120− -> NP I xs
121− -> m (Maybe (Result ys))
117+ -- pqExecPrepared
118+ -- :: AllZip HasEncoding ps xs
119+ -- => PreparedStatement ps ys db db
120+ -- -> NP I xs
121+ -- -> m (Maybe (Result ys))
122122
123123instance AtkeyPQ PQ where
124124
@@ -158,14 +158,14 @@ instance MonadBase IO io => MonadPQ db (PQ db db io) where
158158 result <- liftBase $ LibPQ.execParams conn q params' LibPQ.Binary
159159 return (Result <$> result, Connection conn)
160160
161− pqExecPrepared (q :: PreparedStatement ps ys db0 db1) params =
162− PQ $ \ (Connection conn) -> do
163− let
164− paramValues = encodings (Proxy :: Proxy ps) params
165− params' = [ Just (param', LibPQ.Binary) | param' <- paramValues ]
166− result <- liftBase $
167− LibPQ.execPrepared conn (renderPreparedStatement q) params' LibPQ.Binary
168− return (Result <$> result, Connection conn)
161+ -- pqExecPrepared (q :: PreparedStatement ps ys db0 db1) params =
162+ -- PQ $ \ (Connection conn) -> do
163+ -- let
164+ -- paramValues = encodings (Proxy :: Proxy ps) params
165+ -- params' = [ Just (param', LibPQ.Binary) | param' <- paramValues ]
166+ -- result <- liftBase $
167+ -- LibPQ.execPrepared conn (renderPreparedStatement q) params' LibPQ.Binary
168+ -- return (Result <$> result, Connection conn)
169169
170170instance Monad m => Applicative (PQ db db m) where
171171 pure x = PQ $ \ conn -> pure (x, conn)
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+7−7
@@ -339,13 +339,13 @@ newtype Statement
339339 = UnsafeStatement { renderStatement :: ByteString }
340340 deriving (Show,Eq)
341341
342−newtype PreparedStatement
343− (params :: [ColumnType])
344− (columns :: [(Symbol,ColumnType)])
345− (schema0 :: [(Symbol,[(Symbol,ColumnType)])])
346− (schema1 :: [(Symbol,[(Symbol,ColumnType)])])
347− = UnsafePreparedStatement { renderPreparedStatement :: ByteString }
348− deriving (Show,Eq)
342+-- newtype PreparedStatement
343+-- (params :: [ColumnType])
344+-- (columns :: [(Symbol,ColumnType)])
345+-- (schema0 :: [(Symbol,[(Symbol,ColumnType)])])
346+-- (schema1 :: [(Symbol,[(Symbol,ColumnType)])])
347+-- = UnsafePreparedStatement { renderPreparedStatement :: ByteString }
348+-- deriving (Show,Eq)
349349
350350{-----------------------------------------
351351SELECT statements