[racket] Doubt about ryanc/db unreadable values
It looks like main.the_procedure is returning either defined composite
types or some ad hoc ROW type, neither of which is fully supported by
db. (And I didn't realize I left partial support turned on.)
As a workaround, you can extract the components of the ROW value so
they're separate fields in the query result.
The underlying problem is that the db library requests binary format for
most data types---except datetime types and decimals, which it requests
as text. So mixing the two kinds of data in a single ROW means that the
parts normally received as text can't be read. The solution will be to
add binary readers for the remaining types.
Ryan
On 11/10/2011 04:52 AM, Eduardo Bellani wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello list.
>
> I am somewhat stuck with a mysterious return from my postgresql DB. I
> have a stored procedure that behaves like this:
>
> my_test_db=# select main.the_procedure();
> the_procedure
> - --------------------------------------------
> (1,1,16642,3,"2011-11-10 10:41:58.574135")
> (4,1,16642,3,"2011-11-10 10:42:11.916132")
> (2 rows)
>
> While on racket world:
>
> (require (planet ryanc/db:1:5))
>
> (for/vector ([x
> (in-query (get-db-connection) ;; returns a DB connection
> "select main.the_procedure")])
> (displayln x))
>
>
> =>
>
> #(1 1 16642 3 unreadable)
> #(4 1 16642 3 unreadable)
>
>
> Did anyone stumbled on this behavior before? Any hints?
> Thanks all.
>
> - --
> Eduardo Bellani
>
> omnia mutantur, nihil interit.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEYEARECAAYFAk67yQUACgkQSbLl0kCTjGkAPgCeILJdycRFSFQhiZCSGoe/GuGR
> UkoAoIM20iAE2LXM2xdojMSjVi3JvkUb
> =xTRj
> -----END PGP SIGNATURE-----
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users