Django ORM Playground - Dry ORM

Hello! I’m Xterm!

Your friendly Official Django Discord Helper! :waving_hand:

TL;DR - Go here Dry ORM and hit Execute!

Prologue

How often do you find yourself wanting to test something quickly with the ORM? Possibly some relationship, or a query? How often have you wondered how many queries some queryset or block executes?

If you’re anything like me, you either have some sandbox app in a dummy project that you use as a container for testing; or you create random throw-away projects, with the overhead of setting up the models, generating the migrations, filling the data, prepping some functions to run, running them in the shell (autoreload anyone? ^.^) and/or via some view with DDT loaded.

This rings true even more to those of us that help folks using Django daily on different platforms. We need a way to iterate and quickly run on code shared by others.

For that reason, I created Dry ORM

Dry ORM is a playground that allows you to setup django models and run queries against them fairly quickly, all the while showing you the output and the queries that were generated during the execution. The sessions are ephemeral, lasting enough for the execution to complete.

Here’s a snippet that you can load and run:

https://dryorm.xterm.info/all-features-example

Make changes, save to get a random link or give it a name and save to share friendly url with friends! There’s also a dropdown that shows some examples that you can run and change. You do not need to register or login. Just click and execute. This is a hobby project that I figured could be helpful to some.

For more info, you can check the About section.

I hope you enjoy it! Would love to hear your thoughts!

See you around!

Xterm

12 Likes

Great job. I was looking for a similar tool, and I just found your project. Is it public on GitHub?

Yes. It’s quite dependent on docker and compose. So, clone, build, up and you’re good to go! If you do not want to test against postgres/mariadb, you can just disable those databases in the compose file.

Since posting the above, the following notable changes happened:

  • better support for small screens
  • now sends the DDL from migrations
  • experimental template rendering
  • support for queries output filtering
  • support for mariadb 11.4.5 and postgres 17.4
  • generates a model relationship diagram (Click icon in queries panel header)
  • adds autorun support
  • Cmd+Enter and Ctrl+Enter now run the code
  • you can now copy output and queries
  • execution is now exponentially faster
  • result is now cached