Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It appears to be because rails defaults to using the newer <code>psych</code> YAML engine, the older <code>syck</code> yaml engine doesn't output the <code>!binary</code> keys. If you're just wanting it for testing in the console you can switch back to the older yaml engine as a temp workaround:</p> <pre><code> &gt; y User.first User Load (0.0ms) SELECT "users".* FROM "users" LIMIT 1 --- !ruby/object:User attributes: !binary "aWQ=": 1 !binary "bmFtZQ==": Example User !binary "ZW1haWw=": user@example.com &gt; YAML::ENGINE.yamler= 'syck' =&gt; "syck" &gt; y User.first User Load (1.0ms) SELECT "users".* FROM "users" LIMIT 1 --- !ruby/object:User attributes: id: 1 name: Example User email: user@example.com </code></pre> <p>You would only need to do this when your ActiveRecord column names/attributes keys are encoded using <code>Encoding::ASCII_8BIT</code> which I think only happens with SQLite. </p> <hr> <h2><strong>Update:</strong></h2> <p>Since posting this answer the SQLite3 gem has been fixed to <a href="https://github.com/luislavena/sqlite3-ruby/commit/4a47171747beb938dcf6ff7e4bc5f42a1ed199c9" rel="nofollow">return utf8 for column names</a>. Make sure you're using version 1.3.6 (or higher) of the sqlite3 gem. Then the default/newer psych yaml engine (which also supports human-readable unicode output) will work without problems:</p> <pre><code> &gt; y User.first User Load (0.0ms) SELECT "users".* FROM "users" LIMIT 1 EXPLAIN (0.0ms) EXPLAIN QUERY PLAN SELECT "users".* FROM "users" LIMIT 1 EXPLAIN for: SELECT "users".* FROM "users" LIMIT 1 0|0|0|SCAN TABLE users (~1000000 rows) --- !ruby/object:User attributes: id: 1 name: irmão email: user@example.com </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload