Skip to content

Commit bc5fb7e

Browse files
authored
Merge pull request rails#54453 from skipkayhil/hm-doc-sql-ar
Small tweaks to `sql.active_record` guide [ci skip]
2 parents 56e85a9 + 2f5138e commit bc5fb7e

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

guides/source/active_support_instrumentation.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -355,33 +355,34 @@ The `:cache_hits` key is only included if the collection is rendered with `cache
355355

356356
#### `sql.active_record`
357357

358-
| Key | Value |
359-
| -------------------- | ---------------------------------------- |
360-
| `:sql` | SQL statement |
361-
| `:name` | Name of the operation |
362-
| `:connection` | Connection object |
363-
| `:transaction` | Current transaction, if any |
364-
| `:binds` | Bind parameters |
365-
| `:type_casted_binds` | Typecasted bind parameters |
366-
| `:statement_name` | SQL Statement name |
367-
| `:async` | `true` if query is loaded asynchronously |
368-
| `:cached` | `true` is added when cached queries used |
369-
| `:row_count` | Number of rows returned by the query |
370-
| `:affected_rows` | Number of rows affected by the query |
358+
| Key | Value |
359+
| -------------------- | ------------------------------------------------------ |
360+
| `:sql` | SQL statement |
361+
| `:name` | Name of the operation |
362+
| `:binds` | Bind parameters |
363+
| `:type_casted_binds` | Typecasted bind parameters |
364+
| `:async` | `true` if query is loaded asynchronously |
365+
| `:connection` | Connection object |
366+
| `:transaction` | Current transaction, if any |
367+
| `:affected_rows` | Number of rows affected by the query |
368+
| `:row_count` | Number of rows returned by the query |
369+
| `:cached` | `true` is added when result comes from the query cache |
370+
| `:statement_name` | SQL Statement name (Postgres only) |
371371

372372
Adapters may add their own data as well.
373373

374374
```ruby
375375
{
376376
sql: "SELECT \"posts\".* FROM \"posts\" ",
377377
name: "Post Load",
378-
connection: <ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x00007f9f7a838850>,
379-
transaction: <ActiveRecord::ConnectionAdapters::RealTransaction:0x0000000121b5d3e0>
380378
binds: [<ActiveModel::Attribute::WithCastValue:0x00007fe19d15dc00>],
381379
type_casted_binds: [11],
382-
statement_name: nil,
383-
row_count: 5,
380+
async: false,
381+
connection: <ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x00007f9f7a838850>,
382+
transaction: <ActiveRecord::ConnectionAdapters::RealTransaction:0x0000000121b5d3e0>
384383
affected_rows: 0
384+
row_count: 5,
385+
statement_name: nil,
385386
}
386387
```
387388

0 commit comments

Comments
 (0)