In particular I would like to call the Postgres levenshtein
function.
I would like to write the blaze query to return words similar to the word 'similar', ie the equivalent of:
select word from wordtable where levenshtein(word, 'similar') < 3;
In Blaze this should look something like
db.wordtable.word[levenshtein(db.wordtable.word, 'similar') < 3]
but levenshtein
is not defined in any module I am importing on the python side.
Where/how do I get a levenshtein
definition for use in Blaze expressions on the Python side?
I have found the sqlalchemy.sql.func
package which provides Python handles for SQL functions for use with SqlAlchemy, but these 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?