I am trying to see if I already have an item in the database. However I can't figure out how to select the name with an apostrophe(') in them.
I have tried using adapt, %s (which does not work at all). :item syntax does not work either.
The below select will result in
Exception has occurred: ProgrammingError
(psycopg2.errors.SyntaxError) syntax error at or near "s"
LINE 1: select * from items where name = 'Akunda's Bite'
# CODE
str_sql = text(f"select * from items where name = '{item_name}'")
results = self.conn.execute(str_sql).fetchone()