Examining ORM Queries with Debug SQL Shell in Django Debug Toolbar

Veröffentlicht am: 20 Mai 2023
auf dem Kanal: Pybites
651
15

In this Django Debug Toolbar follow up video, we explore its "Debug SQL Shell" feature / "debugsqlshell" management command.

It allows developers to execute ORM operations while simultaneously displaying the underlying SQL queries.

We show a couple of examples, including the select_related() of the N+1 video we did (linked below), which reduces the amount of queries by using SQL JOINs.

You'll see the SQL that actually gets executed on the DB, very interesting!

We hope this is useful and that you use this, in addition to the Django Debug Toolbar, to optimize your database queries. Remember, ORMs, although great and convenient, can lead to inefficient SQL queries, so it's critical that you look at the underlying SQL.

Links:
Debug toolbar feature: https://django-debug-toolbar.readthed...
Previous video Django Debug Toolbar overview video:    • Mastering Django Debug Toolbar: Effic...  
Previous N+1 Django query optimizing video:    • Optimizing Django Queries: How to Sol...  

---
Learn more about Pybites / what we do: https://pybit.es

Get our weekly developer / mindset emails: https://pybit.es/friends/

Join our Slack community: https://pybit.es/community/

And last but not least, we appreciate any feedback to make our YouTube content better 💡
https://form.jotform.com/230941798741062 🙏


Auf dieser Seite können Sie das Online-Video Examining ORM Queries with Debug SQL Shell in Django Debug Toolbar mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Pybites 20 Mai 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 651 Mal angesehen und es wurde von 15 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!