fuelen

fuelen

Ecto.DevLogger - an alternative logger of SQL queries in development

Ecto.DevLogger is an alternative logger of SQL queries in development

It inlines bindings into the query, so it is easy to copy-paste logged SQL and run it in any IDE for debugging without manual transformation of common elixir terms to string representation (binary UUID, DateTime, Decimal, json, etc). Also, it highlights db time to make slow queries noticeable. Source table and inlined bindings are highlighted as well.

Links

Most Liked

fuelen

fuelen

v0.4.0 has been released :tada:

Now, we support multiple repos and Ecto.Adapters.MyXQL adapter.

BartOtten

BartOtten

This has been added to Ecto.

  • [Ecto.Repo] Log human-readable UUIDs by using pre-dumped query parameters

Still eager to give this lib a try. Good work!

fuelen

fuelen

The library design is based on guessing the suitable type by the shape of the parameter. This means there is a chance of an incorrect representation of the parameter. Here are a couple of examples:

To get rid of guessing, we need more low-level information about types, like Postgrex.Extensions.UUID, Postgrex.Extensions.JSONB, etc. But even Ecto doesn’t operate these types as the modules mentioned above are not public

Moreover, not all database adapters even have similar type representation.

Here is a related discussion https://groups.google.com/g/elixir-ecto/c/5AwUoaEuq4E/m/J9Kbr9FOBAAJ?pli=1

In summary, to have this feature in Ecto, it probably should be implemented on the DB adapter level.

webuhu

webuhu

You’ve pumped my developer happiness to 1_000 today! :yellow_heart:

Thank you very very much.

fuelen

fuelen

v0.2.2 has been released :tada:

The fixes are small, but I’d recommend updating to the latest version.

Where Next?

Popular in Announcing Top

zachdaniel
Ash Framework 3.0: Official Release! I’m here with the fine folks at Gig City Elixir, pushing the button live on stage :sunglasses: T...
New
Schultzer
Hey there, I wrote this low-level library recently, its goal is simply to lower the barrier between Elixir and SQL, and it does that by p...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
BartOtten
Phoenix Live Favicon Favicon manipulation for Phoenix Live A lib enabling dynamic favicons in Phoenix Live View applications. To sho...
New
johantell
Ever struggled with mocking external HTTP services in Elixir tests? Found yourself writing brittle mocks that don’t catch real-world enco...
New
Antrater
Hi there! At Moon Design System, we have been working hard for the past six months on the next generation of our LiveView component libra...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jstimps
I’ve started development on an Ecto Adapter for FoundationDB: GitHub - ecto_foundationdb. FoundationDB is a distributed database with AC...
New
Asd
Hi, I am happy to release the Repatch library for mocking and patching implementation in tests and anywhere else. It brings new possibili...
New
jallum
Hey folks :waving_hand: I’ve been building a distributed key-value store in Elixir/OTP called Bedrock. It implements FoundationDB’s arch...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement