In particular, I would like to name the Postgres levenshtein
function. I would like to write a blaze query to return words similar to the word "similar", that is, the equivalent:
select word from wordtable where levenshtein(word, 'similar') < 3;
In Blaze, it should look something like this:
db.wordtable.word[levenshtein(db.wordtable.word, 'similar') < 3]
but levenshtein
not defined in any module I import on the python side. Where / how do I get a levenshtein
definition for use in Blaze expressions on the Python side?
I found the sqlalchemy.sql.func
package that provides Python descriptors for SQL functions for use with SqlAlchemy, but they do not work in Blaze expressions. Is there an equivalent Blaze package, or how can I use sqlalchemy.sql.func.levenshtein
inside a Blaze expression?
source share