Elixir/SQLAlchemy equivalent to SQL "LIKE" statement? -
i'm using mysqlicious type schema described here simple tagging system. i've read alternative implementations of tagging schema in 4 different threads, , suits needs best.
a collection of entries have tags "apple banana orange" , "strawberry banana lemon", , i'm trying find elixir/sqlalchemy equivalent statement to
select * table tags "%banana%";
i haven't been able find such way structure class.query.filter/filter_by() command, , can't see similar method in documentation either module. there simple way this? or should use raw sql.
extra question: disadvantage of mysqlicious schema case may wish search "%apple%" have "pineapple" returned. there high level way deal test case? or should include leading space in each query?
n.b: care, first experience databases, may overlooking core advantages of schema mentioned in other threads. application logging sentence or 2 task completed, columns [taskid, tags, notes, starttime, stoptime, timetaken], bit simple journal. tutorial purposes. want able search individual tags find out how time spend on given task.
each column has .like method, can used filter clause.
>>> note.query.filter(note.message.like("%somestr%")).all() []
Comments
Post a Comment