I am trying to access and filter out match results by checking for str values eg '30:20' in the allocations.room_number column from allocations table. I am using flask-sqlalchemy and would like to filter out all matching results by using the split_part() from the sqlalchemy func module. I am splitting on the allocations.room_number because it has the value separated by :
check_already_added = db.session.query(allocations).filter(and_(allocations.name == "Filiday", func.split_part(allocations.room_number,':',0) == 30 )).first()
if check_already_added is None:
print(check_already_added)
I get the below error
OperationalError('(sqlite3.OperationalError) no such function: split_part')
I tried using Splitting a SQLAlchemy hybrid field return value but no luck.
What am I doing wrong? I appreciate your help