9

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?

Community
  • 1
  • 1
Roel Vermeulen
  • 594
  • 7
  • 15
  • 1
    No it doesn't. However you could use gce and in there use any database you want. – Zig Mandel Apr 19 '15 at 13:34
  • Yes, CloudSQL is essentially sandboxed MySQL so simply running MySQL (or another DB) on a Compute Engine instance might be your best solution. – Adam Apr 19 '15 at 23:52
  • is a lame that Google does not support this, one of the reason i could consider a Cloud based infrastructure would be the ability to migrate my db to CloudSQL to take advantage of power, performance and scalability so I base my app on UDF and stored procedures. – neavilag Jul 04 '15 at 19:08
  • Apparently if you use GCE (Google Cloud Engine) you can completely control your database. But you cannot do this using GAE (Google App Engine). See http://stackoverflow.com/questions/22697049/what-is-the-difference-between-google-app-engine-and-google-compute-engine for more about the difference. – Roel Vermeulen Aug 26 '15 at 19:48

1 Answers1

12

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.

Community
  • 1
  • 1
David
  • 9,288
  • 1
  • 20
  • 52
  • Agreed. I meant Stored Procedure. I tested the code from the SO article and it gave some SQL errors, but it did create the function however. Thanks for the help! – Roel Vermeulen Sep 24 '15 at 09:59