radar / sql_display
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
63fd4f1
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
MIT-LICENSE | ||
| |
README.markdown | ||
| |
Rakefile | ||
| |
config/ | ||
| |
init.rb | ||
| |
lib/ | ||
| |
log/ | ||
| |
rails/ | ||
| |
spec/ | ||
| |
uninstall.rb |
README.markdown
sql_display
For when you want to display the SQL a query executes, but don't want to go into the log!
Usage Examples
sql takes the same options as find and will only show you the first query it runs.
count_sql takes the same options as count, same deal.
>> Post.sql
=> "SELECT * FROM your_models"
>> Post.sql(:order => "id DESC")
=> "SELECT * FROM posts ORDER id DESC"
>> Post.count_sql
=> "SELECT count(*) AS count_all FROM \"posts\""
>> Post.count_sql(:text)
=> "SELECT count(\"posts\".text) AS count_text FROM \"posts\""
Contributors
perplect

