snipt

Ctrl+h for KB shortcuts

Text only

Display Column Titles SQLite3

1
2
3
4
5
sqlite> .mode column
sqlite> .headers on

.mode column
.headers on
https://snipt.net/embed/22eb8c30597897f28f33ab8b87d09f47/
https://snipt.net/raw/22eb8c30597897f28f33ab8b87d09f47/
22eb8c30597897f28f33ab8b87d09f47
text
Text only
5
2016-09-30T17:19:21
True
False
False
/api/public/snipt/38757/
-66
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>sqlite&gt; .mode column </span><span id="L-2"><a name="L-2"></a>sqlite&gt; .headers on </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>.mode column </span><span id="L-5"><a name="L-5"></a>.headers on </span></pre></div> </td></tr></table>
"column headers", "display columns", "pretty print", column, sqlite, sqlite3

Ruby

Add column migration

1
2
3
4
5
6
7
def self.up
    add_column :table_name, :field_name, :string
  end
 
  def self.down
    remove_column :table_name, :field_name
  end
https://snipt.net/embed/4339ae7eee6c52f644a4207a5c903073/
https://snipt.net/raw/4339ae7eee6c52f644a4207a5c903073/
4339ae7eee6c52f644a4207a5c903073
rb
Ruby
7
2016-09-26T12:25:09
True
False
False
/api/public/snipt/25874/
add-column-migration
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">up</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">add_column</span> <span class="ss">:table_name</span><span class="p">,</span> <span class="ss">:field_name</span><span class="p">,</span> <span class="ss">:string</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">end</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">down</span> </span><span id="L-6"><a name="L-6"></a> <span class="n">remove_column</span> <span class="ss">:table_name</span><span class="p">,</span> <span class="ss">:field_name</span> </span><span id="L-7"><a name="L-7"></a> <span class="k">end</span> </span></pre></div> </td></tr></table>
add, column, migration, rails, ruby
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.