Roel Vermeulen
Roel Vermeulen

Reputation: 634

Alternative to user defined functions in Google's Cloud SQL

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?

Upvotes: 9

Views: 6039

Answers (1)

David
David

Reputation: 9731

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.

Upvotes: 12

Related Questions