Hi Peter,

Thanks a lot for showing these hacks. Clearly, this isn't how jOOQ
should be used in the long run ;-)

But it helps understanding what parts of the code generator and the
core will need to be adapted to finally support these PG* types. It
looks like using the String serialisation of these types, with the
appropriate cast, is a good way to handle such bind values.

For now, PG* types can probably be identified through reflection, in
order to avoid creating compile-time dependencies within jOOQ's core
module. In a future version, I might think about adding new modules
for vendor-specific feature support, exposing PG* type converters,
converting <String, PG*>

I will increase the priority of #982, as formal support for these
Postgres extensions have now been requested many times on the user
group:
https://github.com/jOOQ/jOOQ/issues/982

I think that jOOQ 3.1 will certainly be a good milestone to implement
these things. Feel free to post any other findings that you may have
in the mean time.

Cheers
Lukas

2013/2/25 Peter Cooner <[email protected]>:
> Here we go, hacks abound.
>
> DataType<Object> geometry = new DefaultDataType<>(
>         SQLDialect.POSTGRES, SQLDataType.OTHER, "geometry");
> f.insertInto(TRACK_POSITION, TRACK_POSITION.GEOM_POS)
>         .values(cast(PGgeomPoint.toString(), geometry))
>         .execute();
>
> - Executing query          : insert into "public"."track_position"
> ("geom_pos") values (cast(? as geometry))
> - -> with bind values      : insert into "public"."track_position"
> ("geom_pos") values (cast('SRID=4326;POINT(0 0)' as geometry))
>
> This is what I end up doing to insert PostGIS points until PGobjects can be
> inserted again.
>
>
> --
> Pete
>
> --
> 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/groups/opt_out.
>
>

-- 
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/groups/opt_out.


Reply via email to