README.md in pg-eyeballs-1.0.0 vs README.md in pg-eyeballs-1.1.0
- old
+ new
@@ -2,11 +2,11 @@
# pg-eyeballs 👀
`pg-eyeballs` is a ruby gem that gives you detailed information about how the
SQL queries created by the active record code you write are executed by the database.
It gives you an easy, ruby friendly way to see the output of the Postgres
-[`EXPLAIN` command](https://www.postgresql.org/docs/9.4/static/using-explain.html) and integrates with the popular query analysis tool [`gocmdpev`](https://github.com/simon-engledew/gocmdpev).
+[`EXPLAIN` command](https://www.postgresql.org/docs/9.4/static/using-explain.html) and integrates with the popular query analysis tool [`gocmdpev`](https://github.com/simon-engledew/gocmdpev).
Using it you can see:
- What queries were run
- How long they took
- Which indexes were used
@@ -46,32 +46,32 @@
Most eyeballs methods return an array because an `ActiveRecord::Relation` can run
more than one query, for instance when it has a `preload` or with certain
subqueries
```ruby
User.all.preload(:profiles).eyeballs.explain(options: [:verbose], format: :yaml)
-['- Plan:
+['- Plan:
Node Type: "Seq Scan"
Relation Name: "users"
Schema: "public"
Alias: "users"
Startup Cost: 0.00
Total Cost: 22.30
Plan Rows: 1230
Plan Width: 36
- Output:
+ Output:
- "id"
- - "email"',
- '- Plan:
+ - "email"',
+ '- Plan:
Node Type: "Seq Scan"
Relation Name: "profiles"
Schema: "public"
Alias: "profiles"
Startup Cost: 0.00\
Total Cost: 36.75
Plan Rows: 11
Plan Width: 8
- Output:
+ Output:
- "id"
- "user_id"
Filter: "(profiles.user_id = 1)"'
]
```
@@ -177,20 +177,30 @@
To use, also from inside your Rails project directory, run
```bash
eyeballs User.preload(:profiles)
```
+## Compatibility
+
+`pg-eyeballs` has been tested with Rails versions 4 and 5. It may work on
+earlier versions, but I haven't tried it.
+
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/bradurani/pg-eyeballs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
+### Running the tests
+First, `bundle install`. After this, if you are using the default
+database, first thing is to run `createdb eyeballs_test`. After this
+you can run the tests with `rake`.
+
+
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
-