Ben,

2015-05-05 7:59 GMT+02:00 Lukas Eder <[email protected]>:

> > I see, our integration tests currently only cover SETOF [ table type ].
>> I'll
>> > have to investigate to see whether SETOF BIGINT is really supported
>> already.
>>
>> Ah OK, good to know.
>>
>
> It isn't supported. The code generator doesn't find any columns for the
> table-valued function. That's a bug which should be fixed immediately:
> https://github.com/jOOQ/jOOQ/issues/4269
>

This change seems to fix things in our integration tests:
https://github.com/jOOQ/jOOQ/commit/4ef2b92d3c51a341c22c2b024287b363a196e4fc

I've added the following two test functions:

CREATE OR REPLACE FUNCTION f_search_book_ids(p_title character varying,
p_limit bigint, p_offset bigint)
  RETURNS SETOF INT AS
$BODY$
SELECT id FROM t_book
WHERE (LOWER(title) LIKE LOWER('%' || $1 || '%'))
LIMIT $2 OFFSET $3;
$BODY$
  LANGUAGE sql VOLATILE
  COST 100
  ROWS 1000;
/

CREATE OR REPLACE FUNCTION f_search_book_titles(p_title character varying,
p_limit bigint, p_offset bigint)
  RETURNS SETOF VARCHAR(50) AS
$BODY$
SELECT title FROM t_book
WHERE (LOWER(title) LIKE LOWER('%' || $1 || '%'))
LIMIT $2 OFFSET $3;
$BODY$
  LANGUAGE sql VOLATILE
  COST 100
  ROWS 1000;
/


The fix will be merged to jOOQ 3.6.2.

If you have time to verify the fix already before the release, that would
be greatly appreciated of course. The change didn't incur any regressions
in our integration tests, but there may still be edge-cases or function
return types that we haven't foreseen yet...

Cheers,
Lukas

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to