I'm using the MySQLicious type schema described here for a simple tagging system. I've read some alternative implementations of tagging schema in 4 different SO threads, and this suits my needs best.
A collection of entries have the tags "apple banana orange" and "strawberry banana lemon", and I'm trying to find the Elixir/SQLAlchemy equivalent statement to
SELECT * FROM table WHERE tags LIKE "%banana%";
I haven't been able to find any such way to structure a Class.query.filter/filter_by() command, and can't see a similar method in the documentation for either module. Is there a simple way to do this? Or should I just use raw SQL.
Extra Question: A disadvantage of the MySQLicious schema is the case where I may wish to search for "%apple%" but have "pineapple" returned. Is there a high level way to deal with this test case? Or should I just include a leading space in each query?
n.B: For those who care, this is my first experience with databases, so I may be overlooking core advantages of the schema mentioned in other threads. My application is for logging a sentence or two about a task completed, with columns [TaskID, Tags, Notes, StartTime, StopTime, TimeTaken], a bit like a simple journal. Mostly for tutorial purposes. I want to be able to search by individual tags to find out roughly how much time I spend on a given task.