I can't quite figure this out: I'd like to delete all the records from a table on a matching query. Kind of like this.
engine = sqlalchemy.create_engine(string)
meta = MetaData(bind=engine)
meta.reflect(bind=engine, schema='myschema')
Base = automap_base(metadata=meta)
Base.prepare(engine, reflect=True)
Classes = Base.classes
Session = sessionmaker(bind=engine)
session = Session()
session.delete(plays.record_id == '123')
But that isn't working. What's the idea here? Error I get is:
error in parsing record ID 020087: Class 'sqlalchemy.sql.elements.BinaryExpression' is not mapped