[R-sig-DB] Parameterised queries

Tim Keitt tke|tt @end|ng |rom utex@@@edu
Thu Feb 12 18:22:08 CET 2015


On Thu, Feb 12, 2015 at 10:48 AM, Hadley Wickham <h.wickham using gmail.com>
wrote:

> >> PL/R is able to pull vectors in from R, though RPostgreSQL cannot pulls
> >> arrays from PostgreSQL as vectors (though it would be great to have this
> >> feature).
> >>
> >
> > I've forgotten how DBI works, but an array should just come through in
> text
> > form and you can parse it how ever you want on the R side. You can also
> > send an array by converting it to a string of the appropriate format.
> >
> > rpg has a 'format_for_send' method that you can dispatch on any type to
> > convert it to something PostgreSQL can read. I'm working on something for
> > formatting strings returned from the server.
>
> I've started thinking about a general interface for DBI to do this
> too. It's particularly important for SQLite since it has such limited
> type information.
>

Perhaps its time for DBI2. As long as its not cAmEl. (I've become allergic.)

THK


>
> Ian, if you'd like RPostgres (https://github.com/rstats-db/RPostgres)
> to support arrays natively, please file an issue describing your use
> case and providing a reproducible example that creates a table with
> array data.
>
> Hadley
>
> --
> http://had.co.nz/
>



-- 
http://www.keittlab.org/

	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list