Alternative to user defined functions in Google's Cloud SQL

情到浓时终转凉″ 提交于 2019-12-05 23:40:07

问题


I just transferred my database to Google's Cloud SQL, but as stated in the FAQ on Google Cloud SQL, it says user defined functions are not supported. I am using a function called Levenshtein, taken from this stackoverflow article, to perform a search on a dictionary that I created in my database. It is a function that can find words that look similar (including misspellings) and returns the distance from a given word.

Does Google offer any alternatives to user defined functions that would allow me to use this functionality to perform search?


回答1:


You are confused about terminology:

  • User Defined Function = A function defined in real code, compiled into a DLL/SO, and created in MySQL with CREATE FUNCTION ... SONAME. This is not possible in Cloud SQL.

  • Stored Procedure = A function defined in SQL statements, and created in MySQL with CREATE FUNCTION routine_body or CREATE PROCEDURE. This is allowed in Cloud SQL.

I just tested this out by copying and pasting the definition from that SO post into my Cloud SQL instance and it worked perfectly.



来源:https://stackoverflow.com/questions/29715273/alternative-to-user-defined-functions-in-googles-cloud-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!