Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Tom Ellis
On Wed, Jul 31, 2013 at 05:28:02PM +0600, Alexey Uimanov wrote: > The rationale is that the low-level database interface accepts parameters > directly instead of inserting them inside the query manually. [...] > Low-level database interface knows better how to work with parameters, so > the driver

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Alexey Uimanov
The rationale is that the low-level database interface accepts parameters directly instead of inserting them inside the query manually (like HoleyMonoid would do). Postgresql-simple also does parameter substitution on haskell side. This is not safe and may cause to http://en.wikipedia.org/wiki/SQL_

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Tom Ellis
On Wed, Jul 31, 2013 at 01:22:42PM +0600, Alexey Uimanov wrote: > I also have the idea do not throw the exceptions in IO but return (Either > SqlError a) from all the Connection and Statement methods for safe data > processing. What do you think about ? I feel very strongly that you should use E

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Bardur Arantsson
On 2013-07-31 09:22, Alexey Uimanov wrote: >> >> Regard parameterized SQL: It might be worth using named parameters (e.g. >> ":foo" and ":bar" or something like that) rather than "?" as >> placeholders in SQL/prepared SQL. This will make it slightly more >> flexible if you need to provide different

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Kirill Zaborsky
Alexey, Regarding named parameters - another option is to use numbered parameters like :1, :2 etc. It will help with repeated parameters at least. I didn't understandthe first Bardur's point about "different SQL strings" though. Kind regards, Kirill Zaborsky 2013/7/31 Alexey Uimanov > Regard

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Tom Ellis
On Wed, Jul 31, 2013 at 09:45:50AM +0600, Alexey Uimanov wrote: > Hello, haskellers. This is the first release of HDBI (Haskell Database > Independent interface). Hi, thanks for this Alexey. It's great that there is continued development of this really important infrustructure for Haskell. I hav

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-31 Thread Alexey Uimanov
> > Regard parameterized SQL: It might be worth using named parameters (e.g. > ":foo" and ":bar" or something like that) rather than "?" as > placeholders in SQL/prepared SQL. This will make it slightly more > flexible if you need to provide different SQL strings for different > databases, but want

Re: [Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-30 Thread Bardur Arantsson
On 2013-07-31 05:45, Alexey Uimanov wrote: > Hello, haskellers. This is the first release of HDBI (Haskell Database > Independent interface). It is the fork of HDBC. > HDBI has some improvements in design, it also has better testing and > performance (mainly because of using Text instead of String

[Haskell-cafe] ANNOUNCE: hdbi-1.0.0 and hdbi-postgresql-1.0.0

2013-07-30 Thread Alexey Uimanov
Hello, haskellers. This is the first release of HDBI (Haskell Database Independent interface). It is the fork of HDBC. HDBI has some improvements in design, it also has better testing and performance (mainly because of using Text instead of String anywhere). HDBI designed to be more flexible and co