Handling Exceptions In Flask-SQLAlchemy

Поділитися
Вставка
  • Опубліковано 16 жов 2024
  • This video demonstrates how to handle common exceptions when working with Flask-SQLAlchemy, using an IntegrityError as an example.
    WORK WITH ME👇🏼
    ✅ Implement features and fix bugs in your app: Live, one-on-one screenshare
    prettyprinted....
    Join my free course on the basics of Flask-SQLAlchemy: prettyprinted....

КОМЕНТАРІ • 51

  • @prettyprinted
    @prettyprinted  4 роки тому +3

    Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql

  • @avisekssarma5592
    @avisekssarma5592 4 роки тому +1

    Thank you for making these sort of short and clear videos in problems that can happen in code. You are like stackoverflow in youtube.

  • @stillinmusic
    @stillinmusic 6 років тому +1

    All your videos are so helpful.

  • @sajedkhoshkar
    @sajedkhoshkar 2 роки тому

    Thanks for making these sort of videos. Very useful

  • @kiranbakale8207
    @kiranbakale8207 4 роки тому +1

    I got a Type error
    It says view function did not return a valid response . The function either returned none or ended without a return statement
    Please reply

  • @triple5beats506
    @triple5beats506 5 років тому +1

    What about the "on_conflict_do_nothing()" method? Would this be useful in this situation?

  • @prateeksarangi9187
    @prateeksarangi9187 2 роки тому

    Thanks Anthony !! As always great

  • @nayan1917
    @nayan1917 4 роки тому +1

    Hi Anthony, Please make a video on how to handle Sqlalchemy timeout error for maximum queue pool size reached. It would be very helpful!

  • @Biongar
    @Biongar Рік тому

    How to detect which field raise IntegrityError when we have 2+ unique fields? Example: User should have unique username and unique email, we send both of them when create user

  • @desmondade
    @desmondade 7 років тому +1

    Great video Anthony

  • @arunaacharya5473
    @arunaacharya5473 Рік тому

    can you do a video on how to solve sqlite thread error

  • @fabricio_patrocinio
    @fabricio_patrocinio 3 роки тому

    This video is power, thanks brow!!

  • @shadedeveloping4705
    @shadedeveloping4705 4 роки тому +1

    Great video! Thanks

  • @akhileshverma4812
    @akhileshverma4812 2 роки тому

    Giving an error module flask_sqlalchemy not found
    I have run the command also

  • @quechon1
    @quechon1 7 років тому +1

    Anthony my man very good video

  • @cedricbenonga7778
    @cedricbenonga7778 Рік тому

    How do I still successfully add the same value twice in the flask-sqlalchimy database while handling the integrity error?

    • @prettyprinted
      @prettyprinted  Рік тому

      Just make sure the field you want to add the value in is set to unique=False

  • @satheesh22g
    @satheesh22g 5 років тому +1

    but ,i got sqlalchemy.exc.ProgrammingError
    ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 140258910824192 and this is thread id 140258902431488.how can i solve this

    • @prettyprinted
      @prettyprinted  5 років тому

      It depends on your code. Are you doing anything special in your route with Flask-SQLAlchemy?

  • @prettyprinted
    @prettyprinted  7 років тому

    Thanks for watching everyone! Check out prettyprinted.com for Flask courses.

  • @charlesjoseph809
    @charlesjoseph809 7 років тому +1

    am i need to close the session once request over?

    • @prettyprinted
      @prettyprinted  7 років тому

      Flask-SQLAlchemy should take care of closing the session for you after the request ends.

    • @charlesjoseph809
      @charlesjoseph809 7 років тому

      close need when flask-sqlalchemy used with flask-socketio?

    • @prettyprinted
      @prettyprinted  7 років тому

      In that case, you may have to. I haven't thought about that one yet.

  • @Conekingu
    @Conekingu 5 років тому +1

    Really helpful!!! Thanks

  • @falseee4445
    @falseee4445 5 років тому +1

    Hello, it tells me that IntegrityError is not defined :(

    • @prettyprinted
      @prettyprinted  5 років тому +2

      You can import it from sqlalchemy.

    • @falseee4445
      @falseee4445 5 років тому +1

      @@prettyprinted ok thanks

  • @antoniochacon4017
    @antoniochacon4017 7 років тому +1

    great new video

  • @fakenameforgoogle9168
    @fakenameforgoogle9168 2 роки тому

    Thanks

  • @AKSHITGAURRA
    @AKSHITGAURRA 3 роки тому

    thanks buddy, you saved my ass

  • @NikosKeyZ
    @NikosKeyZ 7 років тому +1

    Start the video at 4.50. You can thank me later!

    • @prettyprinted
      @prettyprinted  7 років тому +4

      Some people like to hear me talk even when I'm not writing code!

    • @NikosKeyZ
      @NikosKeyZ 7 років тому +1

      Pretty Printed of course but people in hurry like me, don't want to hear over and over again same things.

  • @ranjanthapa3964
    @ranjanthapa3964 2 роки тому

    sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: movie__details.genre
    i searched everywhere in google but i didn't get the solution of this error. anyone to help me out