hdbc / hdbc-sqlite3

Sqlite v3 driver for HDBC
BSD 3-Clause "New" or "Revised" License
21 stars 6 forks source link

FlexibleContexts is necessary for GHC 7.10 #14

Closed kazu-yamamoto closed 9 years ago

kazu-yamamoto commented 9 years ago
Database/HDBC/Sqlite3/Connection.hs:81:1:
    Non type-variable argument
      in the constraint: convertible-1.1.1.0:Data.Convertible.Base.Convertible
                           SqlValue a
    (Use FlexibleContexts to permit this)
    When checking that ‘fgettables’ has the inferred type
      fgettables :: forall a.
                    convertible-1.1.1.0:Data.Convertible.Base.Convertible SqlValue a =>
                    Sqlite3 -> ChildList -> IO [a]

Database/HDBC/Sqlite3/Connection.hs:94:6:
    Non type-variable argument
      in the constraint: convertible-1.1.1.0:Data.Convertible.Base.Convertible
                           SqlValue t
    (Use FlexibleContexts to permit this)
    When checking that ‘describeCol’ has the inferred type
      describeCol :: forall t.
                     convertible-1.1.1.0:Data.Convertible.Base.Convertible SqlValue t =>
                     [SqlValue] -> (t, SqlColDesc)
    In an equation for ‘fdescribeTable’:
        fdescribeTable o mchildren name
          = do { sth <- newSth o mchildren True
                        $ "PRAGMA table_info(" ++ name ++ ")";
                 execute sth [];
                 res1 <- fetchAllRows' sth;
                 .... }
          where
              describeCol (_ : name : typ : notnull : df : pk : _)
                = (fromSql name, describeType typ notnull df pk)
              describeType name notnull df pk
                = SqlColDesc
                    (typeId name) Nothing Nothing Nothing (nullable notnull)
              nullable SqlNull = Nothing
              nullable (SqlString "0") = Just True
              nullable (SqlString "1") = Just False
              nullable _ = Nothing
              typeId SqlNull = SqlUnknownT "Any"
              typeId (SqlString t) = typeId' t
              typeId (SqlByteString t) = typeId' $ BUTF8.toString t
              typeId _ = SqlUnknownT "Unknown"
              ....
Failed to install HDBC-sqlite3-2.3.3.0
hesselink commented 9 years ago

Thanks for the report. I'm not using the sqlite3 bindings myself, but would be happy to release a fix. A pull request is very welcome :)

hesselink commented 9 years ago

Fixed in #15.