Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-18 Thread John Lato
From: Michael Snoyman mich...@snoyman.com I took a quick look at the enumerators library, but it doesn't seem to have the necessary support for handling data that comes from arbitrary C API function calls rather than handles or sockets. It does support this, for prior art see yaml[1]

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-18 Thread Michael Snoyman
On Tue, Jan 18, 2011 at 1:17 PM, John Lato jwl...@gmail.com wrote: From: Michael Snoyman mich...@snoyman.com I took a quick look at the enumerators library, but it doesn't seem to have the necessary support for handling data that comes from arbitrary C API function calls rather than

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Leon Smith
On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoyman mich...@snoyman.com wrote: In general I think it would be a good thing to have solid, low-level bindings to PostgreSQL. Well, there is PostgreSQL and libpq on hackage: http://hackage.haskell.org/package/libpq

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Michael Snoyman
On Mon, Jan 17, 2011 at 4:49 PM, Leon Smith leon.p.sm...@gmail.com wrote: On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoyman mich...@snoyman.com wrote: In general I think it would be a good thing to have solid, low-level bindings to PostgreSQL. Well, there is PostgreSQL and libpq on hackage:

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread John Goerzen
On 01/17/2011 10:07 AM, Michael Snoyman wrote: On Mon, Jan 17, 2011 at 4:49 PM, Leon Smithleon.p.sm...@gmail.com wrote: On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoymanmich...@snoyman.com wrote: In general I think it would be a good thing to have solid, low-level bindings to PostgreSQL.

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Michael Snoyman
On Mon, Jan 17, 2011 at 10:52 PM, John Goerzen jgoer...@complete.org wrote: On 01/17/2011 10:07 AM, Michael Snoyman wrote: On Mon, Jan 17, 2011 at 4:49 PM, Leon Smithleon.p.sm...@gmail.com  wrote: On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoymanmich...@snoyman.com  wrote: In general I

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread John Goerzen
On 01/17/2011 03:16 PM, Michael Snoyman wrote: I've brought up before my problem with the convertible package: it encourages usage of partial functions. I would prefer two typeclasses, one for guaranteed conversions and one for conversions which may fail. In fact, that is precisely why

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Michael Snoyman
On Mon, Jan 17, 2011 at 11:38 PM, John Goerzen jgoer...@complete.org wrote: On 01/17/2011 03:16 PM, Michael Snoyman wrote: I've brought up before my problem with the convertible package: it encourages usage of partial functions. I would prefer two typeclasses, one for guaranteed conversions

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-08 Thread Michael Snoyman
On Fri, Jan 7, 2011 at 6:01 PM, John Goerzen jgoer...@complete.org wrote: On 01/07/2011 09:49 AM, John Goerzen wrote: On 01/07/2011 05:24 AM, Michael Snoyman wrote: On Fri, Jan 7, 2011 at 11:44 AM, Iustin Popius...@google.com wrote: Yes, I had a bug reported in persistent-postgresql that I

[Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread Iustin Pop
Hi all, It seems that (at least) the postgresql bindings do not allow pure binary data. I have a simple table: debug=# create table test (name bytea); byteas seems to be the backing type on the DB side for bytestrings. and then I run this: import Database.HDBC.PostgreSQL import

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread Michael Snoyman
On Fri, Jan 7, 2011 at 11:44 AM, Iustin Pop ius...@google.com wrote: Hi all, It seems that (at least) the postgresql bindings do not allow pure binary data. I have a simple table:  debug=# create table test (name bytea); byteas seems to be the backing type on the DB side for bytestrings.

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread John Goerzen
On 01/07/2011 05:24 AM, Michael Snoyman wrote: On Fri, Jan 7, 2011 at 11:44 AM, Iustin Popius...@google.com wrote: Yes, I had a bug reported in persistent-postgresql that I traced back to this bug. I reported the bug, but never heard a response. Frankly, if I had time, I would write a low-level

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread Iustin Pop
On Fri, Jan 07, 2011 at 09:49:35AM -0600, John Goerzen wrote: On 01/07/2011 05:24 AM, Michael Snoyman wrote: On Fri, Jan 7, 2011 at 11:44 AM, Iustin Popius...@google.com wrote: Yes, I had a bug reported in persistent-postgresql that I traced back to this bug. I reported the bug, but never

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread John Goerzen
On 01/07/2011 09:49 AM, John Goerzen wrote: On 01/07/2011 05:24 AM, Michael Snoyman wrote: On Fri, Jan 7, 2011 at 11:44 AM, Iustin Popius...@google.com wrote: Yes, I had a bug reported in persistent-postgresql that I traced back to this bug. I reported the bug, but never heard a response.