Is it possible to set up a Sequelize model in such a way that an instance is written to the database using a PostgreSQL (or PostGIS, in my case) function?
My database leverages PostGIS, and I would like for the value for "the_geom" to be written as a function of the latitude and longitude:
var Site = sequelize.define('site', {
the_geom: 'geometry(Point,4326)',
latitude: DataTypes.DECIMAL,
longitude: DataTypes.DECIMAL
});
The value for the_geom would typically be something like this:
ST_SetSRID(ST_MakePoint(-76.622,39.277),4326)