Home > Back-end >  Raw "Insert" SQL in SQLAlchemy, Flask
Raw "Insert" SQL in SQLAlchemy, Flask

Time:04-07

Values are not added to the database after INSERT query. SELECT is working fine this way

  db = SQLAlchemy(app)
  ...
  session['sql_raw_reports_post'] = "insert into database (x, y) values (xa, ya)"
  r = db.session.execute(session['sql_raw_reports_post'])
  ...
  return 'success'

CodePudding user response:

you can try add

db.commit()

ater "insert" action

  • Related