-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
P1: importantFor issues and PRs.For issues and PRs.dialect: postgresFor issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).For issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type
Description
What you are doing?
Inserting inserting GeoJSON documents with single quotes in an attribute.
What do you expect to happen?
No errors.
What is actually happening?
Errors.
Executing (default): INSERT INTO "boundaries" ("id","name","type","geo","createdAt","updatedAt") VALUES ('0138248','Jacksons'' Gap','place',ST_GeomFromGeoJSON('{"type":"MultiPolygon","properties":{"NAME":"Jacksons' Gap","NAMELSAD":"Jacksons' Gap town","coordinates":[]}'),'2016-06-30 20:45:23.143 +00:00','2016-06-30 20:45:23.143 +00:00') RETURNING *;
SequelizeDatabaseError: syntax error at or near "Gap"
Seems like the GeoJSON string is not being escaped at all, so having a single quote in any property in the GeoJSON is causing a syntax error
Dialect: postgres
Database version: 9.5.3
Sequelize version: 3.23.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1: importantFor issues and PRs.For issues and PRs.dialect: postgresFor issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).For issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type