We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c89b20 commit 1ddfc89Copy full SHA for 1ddfc89
src/Database/PostgreSQL/Simple/Util.hs
@@ -21,15 +21,16 @@ module Database.PostgreSQL.Simple.Util
21
import Control.Exception (finally)
22
import Database.PostgreSQL.Simple (Connection, Only (..), begin,
23
query, rollback)
24
+import GHC.Int (Int64)
25
26
-- | Checks if the table with the given name exists in the database.
27
existsTable :: Connection -> String -> IO Bool
28
existsTable con table =
- fmap checkRowCount (query con q (Only table) :: IO [[Int]])
29
+ fmap checkRowCount (query con q (Only table) :: IO [[Int64]])
30
where
31
q = "select count(relname) from pg_class where relname = ?"
32
- checkRowCount :: [[Int]] -> Bool
33
+ checkRowCount :: [[Int64]] -> Bool
34
checkRowCount ((1:_):_) = True
35
checkRowCount _ = False
36
0 commit comments