How to use the GEOMETRY function from sequelize
Find comprehensive JavaScript sequelize.GEOMETRY code examples handpicked from public code repositorys.
GitHub: osmlab/to-fix-backend
![osmlab profile picture](/osmlab.png?size=40)
18 19 20 21 22 23 24 25 26 27
type: Sequelize.UUID, allowNull: false, unique: 'projectItemId' }, pin: { type: Sequelize.GEOMETRY('POINT', 4326), allowNull: false }, quadkey: { type: Sequelize.STRING,
54 55 56 57 58 59 60 61 62 63
exports._HSTORE = Sequelize.HSTORE; exports._JSON = Sequelize.JSON; exports._JSONB = Sequelize.JSONB; exports._ARRAY = Sequelize.ARRAY; exports._RANGE = Sequelize.RANGE; exports._GEOMETRY = Sequelize.GEOMETRY; exports._GEOGRAPHY = Sequelize.GEOGRAPHY; exports._VIRTUAL = Sequelize.VIRTUAL; exports._ENUM = function (arr) { return Sequelize.ENUM.apply(this, arr);
+ 9 other calls in file
GitHub: draadnl/openstad-api
![draadnl profile picture](/draadnl.png?size=40)
9 10 11 12 13 14 15 16 17 18
if (dbConfig.mysqlSTGeoMode || process.env.MYSQL_ST_GEO_MODE === 'on') { const wkx = require('wkx') Sequelize.GEOMETRY.prototype._stringify = function _stringify(value, options) { return `ST_GeomFromText(${options.escape(wkx.Geometry.parseGeoJSON(value).toWkt())})`; } Sequelize.GEOMETRY.prototype._bindParam = function _bindParam(value, options) { return `ST_GeomFromText(${options.bindParam(wkx.Geometry.parseGeoJSON(value).toWkt())})`; } Sequelize.GEOGRAPHY.prototype._stringify = function _stringify(value, options) { return `ST_GeomFromText(${options.escape(wkx.Geometry.parseGeoJSON(value).toWkt())})`;
+ 3 other calls in file
4 5 6 7 8 9 10 11 12 13
id: { type: Sequelize.BIGINT, primaryKey: true }, origin: { type: Sequelize.GEOMETRY('POINT') }, destination: { type: Sequelize.GEOMETRY('POINT') },
+ 3 other calls in file
115 116 117 118 119 120 121 122 123 124
}, route: { type: Sequelize.GEOMETRY('LINESTRING', 4326) }, altRouteA: { type: Sequelize.GEOMETRY('LINESTRING', 4326), allowNull: true }, altRouteB: { type: Sequelize.GEOMETRY('LINESTRING', 4326),
+ 11 other calls in file
sequelize.col is the most popular function in sequelize (1002 examples)