I'm using activerecord-postgis-adapter and squeel in a geo oriented application. Fetching data using various queries based on find and where is working fine and squeel allows me to use PostgreSQL/PostGIS functions to query based on spatial functions and datatypes.
However, I can't figure out how to access similar functions when performing INSERTs and UPDATEs. Say I want to do something in the line of:
UPDATE object SET raster = ST_AsRaster(ST_Buffer(ST_Point(1,5),10),150, 150, '2BUI')
where id = 12345;
How could I perform such a query? Squeel doesn't even seem to have support for other queries than SELECTs.
In a perfect world I would even want to have Rgeo's datatypes automatically converted when used in UPDATE queries, just like with where queries.
I am aware that I can fall back to
ActiveRecord::Base.connection.execute
, but would rather avoid that unless someone tells me it's the only way.
-ra