Sha256: 37410ab05e8f181d4be5969f4ffe62d7b2cdf718f26e12c6a3644b7fb75f84e9

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

# ActiveRecord::Explainer

activerecord-explainer puts `SQL EXPLAIN` of every queries to **development** log.

You can check every SQL EXPLAIN from development log, without :hand: executions.

## Usage

It's no configuration, and you can puts SQL EXPLAIN of every queries to logs.

![](https://github.com/yhirano55/activerecord-explainer/blob/master/images/capture.png?raw=true)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'activerecord-explainer', group: :development
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install activerecord-explainer

## How it work?

- This gem subscribes `sql.active_record` event provided by the [Active Support instrumentation API](https://guides.rubyonrails.org/active_support_instrumentation.html).
- Subscriber handles payload, and execute EXPLAIN from `ActiveRecord::Base`.

Please check the [implementation](https://github.com/yhirano55/activerecord-explainer/blob/master/lib/activerecord/explainer/subscriber.rb), if you interested in.

## License

[MIT License](https://opensource.org/licenses/MIT)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-explainer-0.1.0 README.md