You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GeomFromText in MySQL changed to ST_GeomFromText #9786
dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).existing workaroundFor issues. There is a known workaround for this issue.status: understoodFor issues. Applied when the issue is understood / reproducible.type: bugDEPRECATED: replace with the "bug" issue type
Unhandled rejection SequelizeDatabaseError: FUNCTION godaven.GeomFromText does not exist
at Query.formatError (C:\projects\website\node_modules\sequelize\lib\dialects\mysql\query.js:247:16) Output, either JSON or SQL
Dialect: mysql
__Dialect version:latest available
__Database version:latest available
__Sequelize version:latest available
__Tested with latest release:latest available
It worked when I changed your datatypes.js file to the following:
GEOMETRY.prototype._stringify = function _stringify(value, options) {
return 'ST_GeomFromText(' + options.escape(Wkt.convert(value)) + ')';
};
Previously it was "GeomFromText", I changed it to "ST_GeomFromText".
My reasoning was because MySQL now changed its syntax to "ST_GeomFromText".
Reacted by Michael, ssbarbee, SHINYA, Balogh Ákos, Valiukas Liutauras, khoand-splus and Andrii Oriekhov
How I can use update query with GIS update with ST_ GeomFromText rather than existing ORM support GeomFromText ? Please can help anyone regarding to this case ?
Currently it gives me this error Unhandled rejection SequelizeDatabaseError: FUNCTION db.GeomFromText does not exist
I have updated the ORM and MySQL version to Ver 8.0.12
has anyone with solution ?
Reacted by Amin Taghikhani, Pedro Augusto de Paula Barbosa, Denny Rachmadi, ssbarbee, Eduardo Santos, Hungry, Terry Owen, gongAll, milnomada, hengki01 and 9 more
Reacted by ssbarbee, gongAll, hengki01, MINKI KIM, Manasseh Abiodun, dev-chloe, Andrii Oriekhov, Ezequiel Ramos and Mohamed Abdelgaber
Reacted by Pham Anh Quoc Phien, Ben Antalek, Benjamin GARDIEN, Jonatan Anauati 🪐, ssbarbee, Jens Vanhooydonck, Davidson Nascimento, Hungry, gongAll, hengki01 and 5 more
Reacted by hengki01, MINKI KIM, dev-chloe, Andrii Oriekhov and Ezequiel Ramos
+1 I've the same issue today. I fix the problem with @MunifTanjim proposition. Can you integrate this fix in new release ? I can help if it's necessary :)
Why so? Nobody can give you any suggestions if you don't share enough information. Which TypeScript version are you using? Which Sequelize version? MySQL version? What are the errors? What are the warnings? What are you trying?
@MunifTanjim Thanks for the quick reply.
I'm using:
typescript: 3.9.7
sequelize: 5.22.3
sequelize-typescript: 1.1.0
Mysql: 8.0
I just retired to get the error and it works. Sorry I wasted your time, I'm not sure what I did differently. Maybe my installed node packages were all mixed up. Thanks!
dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).existing workaroundFor issues. There is a known workaround for this issue.status: understoodFor issues. Applied when the issue is understood / reproducible.type: bugDEPRECATED: replace with the "bug" issue type
Activity
sushantdhiman commentedon Aug 15, 2018
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-0.html
Looks like we need to change this function based on database version.
sansuba commentedon Sep 10, 2018
How I can use update query with GIS update with ST_ GeomFromText rather than existing ORM support GeomFromText ? Please can help anyone regarding to this case ?
Currently it gives me this error
Unhandled rejection SequelizeDatabaseError: FUNCTION db.GeomFromText does not exist
I have updated the ORM and MySQL version to Ver 8.0.12
has anyone with solution ?
maluramichael commentedon Sep 17, 2018
I have this problem too right
sequelize 4.38.0
mysql Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)
Is there any workaround for this?
whittakergroupinc commentedon Nov 9, 2018
I found this to work:
In this file: node_modules/sequelize/lib/data-types.js
On lines 708 and 726 change GeomFromText --> ST_GeomFromText
MunifTanjim commentedon Dec 15, 2018
Until this get's resolved:
Idea from @whittakergroupinc
dragondgold commentedon Mar 18, 2019
This doesn't work anymore with sequelize v5, any workaround for this in v5?
MunifTanjim commentedon Mar 18, 2019
Probably this:
goalia commentedon Nov 1, 2019
+1 I've the same issue today. I fix the problem with @MunifTanjim proposition. Can you integrate this fix in new release ? I can help if it's necessary :)
papb commentedon Nov 2, 2019
Hi everyone! This seems related to the v8 release of MySQL, can anyone confirm? If we make this change, would it break for <v8 users?
3 remaining items
MySQL: Fix GeomFromText -> ST_GeomFromText change
fix(mysql): function name change GeomFromText -> ST_GeomFromText
maulikpatel-in commentedon Nov 1, 2020
Face the same issue with sequelize 6.3.x, and @MunifTanjim solution was worked for me.
blankstar85 commentedon Nov 2, 2020
Are you using typescript? maybe I didn't spend enough time, but its not working for me. any suggestions?
MunifTanjim commentedon Nov 2, 2020
Why so? Nobody can give you any suggestions if you don't share enough information. Which TypeScript version are you using? Which Sequelize version? MySQL version? What are the errors? What are the warnings? What are you trying?
@blankstar85
blankstar85 commentedon Nov 2, 2020
@MunifTanjim Thanks for the quick reply.
I'm using:
typescript: 3.9.7
sequelize: 5.22.3
sequelize-typescript: 1.1.0
Mysql: 8.0
I just retired to get the error and it works. Sorry I wasted your time, I'm not sure what I did differently. Maybe my installed node packages were all mixed up. Thanks!
NoufalBhai commentedon Feb 8, 2021
Is this fixed?
I'm still getting the same issue.
hengki01 commentedon Feb 16, 2021
It's almost 2 years and still works !
Hwan-seok commentedon Apr 20, 2021
Why is this not being fixed?
neel2902 commentedon Apr 21, 2021
I am using
In node_modules/sequelize/lib/data-types.js
In line 847 and 850, changing GeomFromText to ST_GeomFromText did the job for me.
incorporate a workaround for sequelize's MySql geometry bug: sequeliz…
err : GeomFromText does not exist
fix(mysql): function name change GeomFromText -> ST_GeomFromText
sgambolati-ua commentedon May 9, 2023
This works for me. Thanks!
Is there a better way to overload/extend a data type?