radar / sql_display
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
commit d7dcbbe8c6165df156a144d4ab5e348dcfdd1dd2
tree 45bbf8b7d1375d939f766cf3f053d2b8744ea4d5
parent 63fd4f171311e23c795abc9c737e61736f563afd
tree 45bbf8b7d1375d939f766cf3f053d2b8744ea4d5
parent 63fd4f171311e23c795abc9c737e61736f563afd
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jun 10 04:35:18 -0700 2009 | |
| |
MIT-LICENSE | Wed Jun 10 04:35:18 -0700 2009 | |
| |
README.markdown | Fri Sep 11 18:20:50 -0700 2009 | |
| |
Rakefile | Fri Sep 11 18:15:53 -0700 2009 | |
| |
config/ | Sun Jun 14 01:36:42 -0700 2009 | |
| |
init.rb | Sun Jun 14 01:36:42 -0700 2009 | |
| |
lib/ | Fri Sep 11 18:15:53 -0700 2009 | |
| |
log/ | Thu Jun 11 01:00:59 -0700 2009 | |
| |
rails/ | Fri Sep 11 18:15:53 -0700 2009 | |
| |
spec/ | Fri Sep 11 18:20:50 -0700 2009 | |
| |
uninstall.rb | Wed Jun 10 04:35:18 -0700 2009 |
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 \"posts\""
>> Post.sql(:order => "id DESC")
=> "SELECT * FROM \"posts\" ORDER id DESC"
>> Post.scoped({}).sql
=> "SELECT * FROM \"posts\""
>> 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
