Repository navigation
Adding GEOMETRY Support - #4013
Conversation
|
Locally
|
|
@janmeier if there's anything else that'd you'd like me to change, let me know. Otherwise I'll begin adding MySQL support in another PR. |
|
@mikeringrose Nope, everything looks good! Looking forward to the next PR :) |
There was a problem hiding this comment.
hey @mikeringrose, I think you are either missing another term in this statement, or need to remove the leading "+". I tried creating geometry with DataTypes.GEOMETRY("Point", 4326) and ended up having bad queries generated due to this line.
There was a problem hiding this comment.
Thanks for the heads up. I'll be submitting a fix for this issue tomorrow
to address the following bug -
#4054. If you need things to
work for now, you can leave off the SRID. Thanks again.
Mike Ringrose
On Tue, Jul 7, 2015 at 9:22 PM, Kris Rasmussen [email protected]
wrote:
In lib/dialects/postgres/query-generator.js
#4013 (comment):@@ -897,6 +897,13 @@ var QueryGenerator = {
return 'ARRAY[' + value.map(function (v) {
return SqlString.escape(JSON.stringify(v), false, this.options.timezone, this.dialect, field);
}, this).join(',') + ']::' + jsonType.key + '[]';
- } else if (value && field && field.type instanceof DataTypes.GEOMETRY) {
var s = "ST_GeomFromGeoJSON('" + JSON.stringify(value) + "'";if (field.type.srid) {s += + ", " + field.type.srid;hey @mikeringrose https://github.com/mikeringrose, I think you are
either missing another term in this statement, or need to remove the
leading "+". I tried creating geometry with DataTypes.GEOMETRY("Point",
4326) and ended up having bad queries generated due to this line.—
Reply to this email directly or view it on GitHub
https://github.com/sequelize/sequelize/pull/4013/files#r34108922.
|
What is the syntax for sequelize postgres geometry? Is there a HelloWorld example? |
|
@mshahriarinia We will add documentation for this once all dialects are supported. Until then Id recommend you to look at the tests in this PR to see the syntax |
|
Can I do distance calculation between a lat/lon and a point column in potgres in current state or top k closest points to a given point? I went through all sorts of code, looks like somebody introduced the concept of |
|
@mshahriarinia Unfortunately those operators were not integrated into the final pull request. They would definitely be nice to have, so a PR to re-add them would be very wellcome! The code should be pretty similar to whats in this PR, just needs to be migrated |
|
That'd be awesome if we could get those in. 👍 On Mon, Jul 13, 2015 at 3:17 AM, Jan Aagaard Meier <[email protected]
|
This is to replace PR #3828. Same code added to the latest in master.