packages feed

HDBC 2.3.1.0 → 2.3.1.1

raw patch · 5 files changed

+44/−71 lines, 5 filesdep ~basedep ~timenew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, time

API changes (from Hackage documentation)

+ Database.HDBC.SqlValue: instance Convertible SqlValue SqlValue
- Database.HDBC: class IConnection conn
+ Database.HDBC: class IConnection conn where runRaw conn sql = do { sth <- prepare conn sql; _ <- execute sth [] `finally` finish sth; return () }
- Database.HDBC.Types: class IConnection conn
+ Database.HDBC.Types: class IConnection conn where runRaw conn sql = do { sth <- prepare conn sql; _ <- execute sth [] `finally` finish sth; return () }

Files

Database/HDBC/SqlValue.hs view
@@ -242,6 +242,9 @@     a == b = ((safeFromSql a)::ConvertResult String) ==               ((safeFromSql b)::ConvertResult String) +instance Convertible SqlValue SqlValue where+    safeConvert = return+ instance Convertible String SqlValue where     safeConvert = return . SqlString instance Convertible SqlValue String where@@ -503,7 +506,7 @@     safeConvert (SqlTimeDiff x) = numToBool x     safeConvert y@(SqlNull) = quickError y -numToBool :: Num a => a -> ConvertResult Bool+numToBool :: (Eq a, Num a) => a -> ConvertResult Bool numToBool x = Right (x /= 0)  instance Convertible Char SqlValue where@@ -511,7 +514,7 @@ instance Convertible SqlValue Char where     safeConvert (SqlString [x]) = return x     safeConvert y@(SqlString _) = convError "String length /= 1" y-    safeConvert y@(SqlByteString x) = +    safeConvert (SqlByteString x) =           safeConvert . SqlString . BUTF8.toString $ x     safeConvert y@(SqlInt32 _) = quickError y     safeConvert y@(SqlInt64 _) = quickError y
HDBC.cabal view
@@ -1,12 +1,12 @@ Name: HDBC-Version: 2.3.1.0+Version: 2.3.1.1 License: BSD3 Maintainer: Nicolas Wu <nick@well-typed.com> Author: John Goerzen-homepage: https://github.com/jgoerzen/hdbc/wiki+homepage: https://github.com/hdbc/hdbc Copyright: Copyright (c) 2005-2011 John Goerzen license-file: LICENSE-extra-source-files: LICENSE, Makefile, Memory.txt, README.txt+extra-source-files: LICENSE, Makefile, README.md Category: Database synopsis: Haskell Database Connectivity Description: HDBC provides an abstraction layer between Haskell programs and SQL@@ -20,7 +20,7 @@  source-repository head   type:            git-  location:        https://github.com/jgoerzen/hdbc.git+  location:        https://github.com/hdbc/hdbc.git  flag splitBase   description: Choose the new smaller, split-up base package.@@ -33,7 +33,7 @@  library   if flag(splitBase)-    Build-Depends: base>=3 && <5, old-time, time>=1.1.2.4 && <=1.2.0.5, bytestring, containers, old-locale+    Build-Depends: base>=3 && <5, old-time, time>=1.1.2.4 && <=1.5, bytestring, containers, old-locale     if flag(time_gte_113)       Build-Depends: time>=1.1.3       CPP-OPTIONS: -DTIME_GT_113@@ -64,7 +64,7 @@       Build-Depends: HUnit, QuickCheck (>= 2.0), testpack (>= 2.0)        if flag(splitBase)-        Build-Depends: base>=3 && <5, old-time, time>=1.1.2.4 && <=1.1.4, bytestring, containers, old-locale+        Build-Depends: base>=3 && <5, old-time, time>=1.1.2.4 && <=1.5, bytestring, containers, old-locale         if flag(time_gte_113)           Build-Depends: time>=1.1.3           CPP-OPTIONS: -DTIME_GT_113
− Memory.txt
@@ -1,24 +0,0 @@-Notes on memory management-----------------------------ForeignPtrs are used wherever possible to make sure we don't have-memory leaks.--However, there is one potential problem with them.  If a whole bunch-of database stuff goes out of scope all at once, then the Connection,-Statement, and everything else could become finalizable all at once.-And it is not guaranteed to be finalized in any particular order.--We don't want to have the Connection finalized before the Statements.-This could cause segfaults with some databases.--So we implement a simple reference counting system for the-Connection.  Each use -- whether in a Connection or a Statement ---counts as one, and the whole thing is freed when the use count drops-to 0 (the last object using it has been finalized).--That solves almost every problem.  We have one more: when somebody-calls disconnect on the parent, we really want to close all open-statements first.  So a system of weak refs is used to handle that.-This makes sure that we free things in the proper order for explicit-disconnects as well.
+ README.md view
@@ -0,0 +1,33 @@+HDBC+====++Welcome to HDBC, Haskell Database Connectivity.++HDBC is modeled loosely on Perl's DBI interface, though it has also+been influenced by Python's DB-API v2, JDBC in Java, and HSQL in+Haskell.++Please see the HDBC [wiki](https://github.com/hdbc/hdbc/wiki) for an+introduction to HDBC and its various features.++Installation+------------++You'll need either GHC 6.4.1 or above, or Hugs 2005xx or above.++The steps to install are:++    ghc --make -o setup Setup.lhs+    ./setup configure+    ./setup build+    sudo ./setup install++If you're on Windows, you can omit the leading "./".++Usage+-----++To use with hugs, you'll want to use hugs -98.++To use with GHC, you'll want to use -package HDBC in your programs.+Or, with Cabal, use Build-Depends: HDBC.
− README.txt
@@ -1,39 +0,0 @@-Welcome to HDBC, Haskell Database Connectivity.--HDBC is modeled loosely on Perl's DBI interface, though it has also-been influenced by Python's DB-API v2, JDBC in Java, and HSQL in-Haskell.--Please see doc/Database-HDBC.html for an introduction to HDBC and its-various features.--INSTALLATION---------------You'll need either GHC 6.4.1 or above, or Hugs 2005xx or above.--The steps to install are:--1) ghc --make -o setup Setup.lhs--2) ./setup configure--3) ./setup build--4) ./setup install   (as root)--If you're on Windows, you can omit the leading "./".--Documentation is in doc/ -- lots of information, including pointers to-drivers, is in doc/Database-HDBC.html.--USAGE--------To use with hugs, you'll want to use hugs -98.--To use with GHC, you'll want to use -package HDBC in your programs.-Or, with Cabal, use Build-Depends: HDBC.---- John Goerzen-   December 2005