HDBC-sqlite3 2.3.0.0 → 2.3.1.0
raw patch · 2 files changed
+34/−6 lines, 2 filesdep −QuickCheckdep ~HDBCPVP ok
version bump matches the API change (PVP)
Dependencies removed: QuickCheck
Dependency ranges changed: HDBC
API changes (from Hackage documentation)
Files
Database/HDBC/Sqlite3/Connection.hs view
@@ -91,7 +91,7 @@ Impl.dbTransactionSupport = True, Impl.dbServerVer = ver, Impl.getTables = fgettables obj children,- Impl.describeTable = \_ -> fail $ "Sqlite3 backend does not support describeTable",+ Impl.describeTable = fdescribeTable obj children, Impl.setBusyTimeout = fsetbusy obj} fgettables o mchildren =@@ -100,6 +100,33 @@ res1 <- fetchAllRows' sth let res = map fromSql $ concat res1 return $ seq (length res) res+ +fdescribeTable o mchildren name = do + sth <- newSth o mchildren True $ "PRAGMA table_info(" ++ name ++ ")"+ execute sth []+ res1 <- fetchAllRows' sth+ return $ map describeCol res1+ 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 ('i':'n':'t':_)) = SqlIntegerT+ typeId (SqlString "text") = SqlVarCharT+ typeId (SqlString "real") = SqlRealT+ typeId (SqlString "blob") = SqlVarBinaryT+ typeId (SqlString "") = SqlUnknownT "Any"+ typeId (SqlString other) = SqlUnknownT other+ typeId _ = SqlUnknownT "Unknown"+ fsetbusy o ms = withRawSqlite3 o $ \ppdb -> sqlite3_busy_timeout ppdb ms
HDBC-sqlite3.cabal view
@@ -1,5 +1,5 @@ Name: HDBC-sqlite3-Version: 2.3.0.0+Version: 2.3.1.0 License: LGPL Maintainer: John Goerzen <jgoerzen@complete.org> Author: John Goerzen@@ -7,6 +7,7 @@ license-file: COPYRIGHT extra-source-files: COPYING, hdbc-sqlite3-helper.h, Makefile homepage: http://software.complete.org/hdbc-sqlite3+Category: Database synopsis: Sqlite v3 driver for HDBC Description: This is the Sqlite v3 driver for HDBC, the generic database access system for Haskell@@ -21,7 +22,7 @@ default: False Library- Build-Depends: base>=4 && < 5, bytestring, mtl, HDBC>=2.2.0, utf8-string+ Build-Depends: base>=4 && < 5, bytestring, mtl, HDBC>=2.2.6, utf8-string C-Sources: hdbc-sqlite3-helper.c include-dirs: .@@ -38,12 +39,12 @@ ForeignFunctionInterface, EmptyDataDecls, ScopedTypeVariables,- PatternSignatures+ ScopedTypeVariables Executable runtests if flag(buildtests) Buildable: True- Build-Depends: HUnit, QuickCheck, testpack, containers, convertible, + Build-Depends: HUnit, testpack, containers, convertible, old-time, time, old-locale else Buildable: False@@ -70,4 +71,4 @@ ForeignFunctionInterface, EmptyDataDecls, ScopedTypeVariables,- PatternSignatures+ ScopedTypeVariables