<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Meet Rajesh Gor</title>
    <description>The latest articles on DEV Community by Meet Rajesh Gor (@mr_destructive).</description>
    <link>https://dev.to/mr_destructive</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F506117%2F4cbf6e39-2932-4c16-8d5b-758470ea3f6d.png</url>
      <title>DEV Community: Meet Rajesh Gor</title>
      <link>https://dev.to/mr_destructive</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mr_destructive"/>
    <language>en</language>
    <item>
      <title>This is so cool. Actually supporting writers and developers to grow their audience without hassle of managing multiple platforms</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Fri, 13 Mar 2026 04:34:31 +0000</pubDate>
      <link>https://dev.to/mr_destructive/this-is-so-cool-actually-supporting-writers-and-developers-to-grow-their-audience-without-hassle-32e8</link>
      <guid>https://dev.to/mr_destructive/this-is-so-cool-actually-supporting-writers-and-developers-to-grow-their-audience-without-hassle-32e8</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/devteam/revamped-rss-feed-imports-3j1e" class="crayons-story__hidden-navigation-link"&gt;Revamped RSS Feed Imports&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/devteam"&gt;
            &lt;img alt="The DEV Team logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1%2Fd908a186-5651-4a5a-9f76-15200bc6801f.jpg" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/jonmarkgo" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F379485%2Fd1c1869a-68d7-4536-a542-7775cb27d3e9.jpeg" alt="jonmarkgo profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/jonmarkgo" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Jon Gottfried
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Jon Gottfried
                
              
              &lt;div id="story-author-preview-content-3330944" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/jonmarkgo" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F379485%2Fd1c1869a-68d7-4536-a542-7775cb27d3e9.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Jon Gottfried&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/devteam" class="crayons-story__secondary fw-medium"&gt;The DEV Team&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/devteam/revamped-rss-feed-imports-3j1e" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 9&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/devteam/revamped-rss-feed-imports-3j1e" id="article-link-3330944"&gt;
          Revamped RSS Feed Imports
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/forem"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;forem&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devto"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devto&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/rss"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;rss&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/devteam/revamped-rss-feed-imports-3j1e" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/raised-hands-74b2099fd66a39f2d7eed9305ee0f4553df0eb7b4f11b01b6b1b499973048fe5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;53&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/devteam/revamped-rss-feed-imports-3j1e#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              15&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




</description>
      <category>forem</category>
      <category>devto</category>
      <category>rss</category>
    </item>
    <item>
      <title>SQLite dot commands: Output mode separator command</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Sat, 20 Sep 2025 11:57:37 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-output-mode-separator-command-4656</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-output-mode-separator-command-4656</guid>
      <description>&lt;h2&gt;
  
  
  Using the separator for the output
&lt;/h2&gt;

&lt;p&gt;If you wanted to use a specific separator for columns and rows while displaying the result set / table, you can use the &lt;code&gt;.separator&lt;/code&gt; dot command which can take 2 arguments, first as the separator for the column and the second for the row.&lt;/p&gt;

&lt;p&gt;So, if we set use &lt;code&gt;.separator "|" "---"&lt;/code&gt; then it will split the columns with &lt;code&gt;|&lt;/code&gt; and each row with &lt;code&gt;---&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1|The Hobbit|J.R.R. Tolkien|310|1937-09-21|39.99---2|The Fellowship of the Ring|J.R.R. Tolkien|423|1954-07-29|49.99---3|The Two Towers|J.R.R. Tolkien|352|1954-11-11|49.99---4|The Return of the King|J.R.R. Tolkien|416|1955-10-20|49.99---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The output looks wired but I was giving a example.&lt;/p&gt;

&lt;p&gt;The row separator is by default a &lt;code&gt;\n&lt;/code&gt; character or &lt;code&gt;\r\n&lt;/code&gt; on windows, which is for the list or any other mode. However if you want to add those, you need to specify it in the string like below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.separator "|" "\n---"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;sqlite&amp;gt;.separator "|" "\n---"
sqlite&amp;gt; select * from books;
1|The Hobbit|J.R.R. Tolkien|310|1937-09-21|39.99
---2|The Fellowship of the Ring|J.R.R. Tolkien|423|1954-07-29|49.99
---3|The Two Towers|J.R.R. Tolkien|352|1954-11-11|49.99
---4|The Return of the King|J.R.R. Tolkien|416|1955-10-20|49.99
---sqlite&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;\n---&lt;/code&gt; will add it at the end of each row, so the first row won't have it if you are seeing the above output and confused, then that's the expected result.&lt;/p&gt;

&lt;p&gt;You can also use &lt;code&gt;\r&lt;/code&gt; or &lt;code&gt;\t&lt;/code&gt; for the row separator, and for the column separator you can use &lt;code&gt;\n&lt;/code&gt; or &lt;code&gt;\t&lt;/code&gt; or &lt;code&gt;\r&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The modes that will respect the separator setting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;list&lt;/li&gt;
&lt;li&gt;quote&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sadly only two, since for changing the row separator you need to pass the column separator first, so that defeats the purpose of the change in the row separator, you'll have to override the column separator first and then the row.&lt;/p&gt;

&lt;p&gt;So, for the mode &lt;code&gt;tabs&lt;/code&gt;, if you want to keep the columns separator as is, but change the row separator then you can do something like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode tabs
.separator "\t" "\n\n"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will keep the column separator as is and change the row separator to &lt;code&gt;\n\n&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlite&amp;gt; .mode tabs
sqlite&amp;gt; .separator "\t" "\n\n"
sqlite&amp;gt; select * from books;
id      title   author  pages   release_date    price

1       The Hobbit      J.R.R. Tolkien  310     1937-09-21      39.99

2       The Fellowship of the Ring      J.R.R. Tolkien  423     1954-07-29      49.99

3       The Two Towers  J.R.R. Tolkien  352     1954-11-11      49.99

4       The Return of the King  J.R.R. Tolkien  416     1955-10-20      49.99

sqlite&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Similarly for csv you would keep the separator as , and then pass the row separator&lt;/p&gt;

&lt;p&gt;Nice tricks to know.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.sqlite.org/cli.html#changing_output_formats" rel="noopener noreferrer"&gt;SQLite dot commands: Changing output formats&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-mode-dot-command-separators/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-mode-dot-command-separators/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-mode-dot-command-separators/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: Output mode separator command | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Using the separator for the ouput If you wanted to use a specific separator for columns and rows while displaying the result set / table, you can use the dot co
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite dot commands: Output mode</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Fri, 19 Sep 2025 16:23:17 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-output-mode-23b1</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-output-mode-23b1</guid>
      <description>&lt;h2&gt;
  
  
  Output mode dot command
&lt;/h2&gt;

&lt;p&gt;The SQLite shell is a great way to test out and run bunch of queries, but the output might be squished or cluttered. You might need to view the output in a specific way, and the creators of SQLite were already hearing your screams.&lt;/p&gt;

&lt;p&gt;They created not 5, not 10, but 14 different output modes, and to extend it even further, you can even use any delimiter/separator as well.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.mode&lt;/code&gt; will give you the currently configured/set output mode with some options which are default for certain type of modes.&lt;/p&gt;

&lt;p&gt;The default mode is &lt;code&gt;list&lt;/code&gt;, with the option of &lt;code&gt;escape&lt;/code&gt; with the ascii character set.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;current output mode: list --escape ascii
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The list mode defined in the &lt;a href="https://www.sqlite.org/cli.html#changing_output_formats" rel="noopener noreferrer"&gt;docs&lt;/a&gt; as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In list mode, each row of a query result is written on one line of output and each column within that row is separated by a specific separator string. The default separator is a pipe symbol ("|"). List mode is especially useful when you are going to send the output of a query to another program (such as AWK) for additional processing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, in short, the &lt;code&gt;list&lt;/code&gt; output mode prints each row on a line with a &lt;code&gt;|&lt;/code&gt; as the separator.&lt;/p&gt;

&lt;p&gt;You can get all the information you need with the &lt;code&gt;.help mode&lt;/code&gt; command&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode ?MODE? ?OPTIONS?   Set output mode
   MODE is one of:
     ascii       Columns/rows delimited by 0x1F and 0x1E
     box         Tables using unicode box-drawing characters
     csv         Comma-separated values
     column      Output in columns.  (See .width)
     html        HTML \&amp;lt;table\&amp;gt; code
     insert      SQL insert statements for TABLE
     json        Results in a JSON array
     line        One value per line
     list        Values delimited by "|"
     markdown    Markdown table format
     qbox        Shorthand for "box --wrap 60 --quote"
     quote       Escape answers as for SQL
     table       ASCII-art table
     tabs        Tab-separated values
     tcl         TCL list elements
   OPTIONS: (for columnar modes or insert mode):
     --escape T     ctrl-char escape; T is one of: symbol, ascii, off
     --wrap N       Wrap output lines to no longer than N characters
     --wordwrap B   Wrap or not at word boundaries per B (on/off)
     --ww           Shorthand for "--wordwrap 1"
     --quote        Quote output text as SQL literals
     --noquote      Do not quote output text
     TABLE          The name of SQL table used for "insert" mode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's set up with some sample data&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;books&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="n"&gt;AUTOINCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;release_date&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="nb"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;books&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;release_date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'The Hobbit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'J.R.R. Tolkien'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;310&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1937-09-21'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;39&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'The Fellowship of the Ring'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'J.R.R. Tolkien'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;423&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1954-07-29'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'The Two Towers'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'J.R.R. Tolkien'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;352&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1954-11-11'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'The Return of the King'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'J.R.R. Tolkien'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;416&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1955-10-20'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;books&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1|The Hobbit|J.R.R. Tolkien|310|1937-09-21|39.99
2|The Fellowship of the Ring|J.R.R. Tolkien|423|1954-07-29|49.99
3|The Two Towers|J.R.R. Tolkien|352|1954-11-11|49.99
4|The Return of the King|J.R.R. Tolkien|416|1955-10-20|49.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Not the best way to look at the data, but handy in some cases. We can change it, we have 14 different modes to choose from.&lt;br&gt;
Its like choosing a taste flovour for an ice-cream, you want something different each time, or you stick to the simple vanilla one. Which one are you? I am a vanilla guy (I like the table mode, but use csv heavily too).&lt;/p&gt;

&lt;p&gt;Let's change it to a table format with &lt;code&gt;.mode table&lt;/code&gt; This will set the mode as &lt;code&gt;table&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;table       ASCII-art table&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This will show the result sets in a ascii-like table structure with the &lt;code&gt;+++&lt;/code&gt; and &lt;code&gt;---&lt;/code&gt; to separate the rows and columns.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----+----------------------------+----------------+-------+--------------+-------+
| id |           title            |     author     | pages | release_date | price |
+----+----------------------------+----------------+-------+--------------+-------+
| 1  | The Hobbit                 | J.R.R. Tolkien | 310   | 1937-09-21   | 39.99 |
| 2  | The Fellowship of the Ring | J.R.R. Tolkien | 423   | 1954-07-29   | 49.99 |
| 3  | The Two Towers             | J.R.R. Tolkien | 352   | 1954-11-11   | 49.99 |
| 4  | The Return of the King     | J.R.R. Tolkien | 416   | 1955-10-20   | 49.99 |
+----+----------------------------+----------------+-------+--------------+-------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That is soo nice looking! Crystal clear.&lt;/p&gt;

&lt;p&gt;You can even see the current set mode precisely with the &lt;code&gt;.mode&lt;/code&gt; command&lt;/p&gt;

&lt;p&gt;Since I changed the mode to table, let's see what the mode is now set as?&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlite&amp;gt; .mode
current output mode: table --wrap 60 --wordwrap off --noquote --escape ascii
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It has a bunch of options like &lt;code&gt;wrap&lt;/code&gt;, &lt;code&gt;wordwrap&lt;/code&gt;, &lt;code&gt;noquote&lt;/code&gt;, and &lt;code&gt;escape&lt;/code&gt; etc. You can take a look at the help and tweak them as per your liking, I usually don't change the options, but it might be very rare to switch from the defaults.&lt;/p&gt;
&lt;h2&gt;
  
  
  Output modes
&lt;/h2&gt;
&lt;h3&gt;
  
  
  ASCII
&lt;/h3&gt;

&lt;p&gt;This mode separates the columns with by &lt;code&gt;0x1F&lt;/code&gt; and rows with &lt;code&gt;0x1E&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode ascii
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;idtitleauthorpagesrelease_dateprice1The HobbitJ.R.R. Tolkien3101937-09-2139.992The Fellowship of the RingJ.R.R. Tolkien4231954-07-2949.993The Two TowersJ.R.R. Tolkien3521954-11-1149.994The Return of the KingJ.R.R. Tolkien4161955-10-2049.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Box
&lt;/h3&gt;

&lt;p&gt;The box mode renders the result set using unicode box-drawing characters.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode box
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────┬────────────────────────────┬────────────────┬───────┬──────────────┬───────┐
│ id │           title            │     author     │ pages │ release_date │ price │
├────┼────────────────────────────┼────────────────┼───────┼──────────────┼───────┤
│ 1  │ The Hobbit                 │ J.R.R. Tolkien │ 310   │ 1937-09-21   │ 39.99 │
│ 2  │ The Fellowship of the Ring │ J.R.R. Tolkien │ 423   │ 1954-07-29   │ 49.99 │
│ 3  │ The Two Towers             │ J.R.R. Tolkien │ 352   │ 1954-11-11   │ 49.99 │
│ 4  │ The Return of the King     │ J.R.R. Tolkien │ 416   │ 1955-10-20   │ 49.99 │
└────┴────────────────────────────┴────────────────┴───────┴──────────────┴───────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  CSV
&lt;/h3&gt;

&lt;p&gt;The csv mode simply outputs the result in the comma-separated values for columns and newline character for rows.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode csv
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1,"The Hobbit","J.R.R. Tolkien",310,1937-09-21,39.99
2,"The Fellowship of the Ring","J.R.R. Tolkien",423,1954-07-29,49.99
3,"The Two Towers","J.R.R. Tolkien",352,1954-11-11,49.99
4,"The Return of the King","J.R.R. Tolkien",416,1955-10-20,49.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Column
&lt;/h3&gt;

&lt;p&gt;The column mode simply outputs the result in columns with certain width. We can set the option &lt;code&gt;.width&lt;/code&gt; to change the width.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode column
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id  title                       author          pages  release_date  price
--  --------------------------  --------------  -----  ------------  -----
1   The Hobbit                  J.R.R. Tolkien  310    1937-09-21    39.99
2   The Fellowship of the Ring  J.R.R. Tolkien  423    1954-07-29    49.99
3   The Two Towers              J.R.R. Tolkien  352    1954-11-11    49.99
4   The Return of the King      J.R.R. Tolkien  416    1955-10-20    49.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  HTML
&lt;/h3&gt;

&lt;p&gt;The html output mode simply renders the result set / tables into an table element in html.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode html
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;TR&amp;gt;&amp;lt;TH&amp;gt;&lt;/span&gt;id&lt;span class="nt"&gt;&amp;lt;/TH&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TH&amp;gt;&lt;/span&gt;title&lt;span class="nt"&gt;&amp;lt;/TH&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TH&amp;gt;&lt;/span&gt;author&lt;span class="nt"&gt;&amp;lt;/TH&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TH&amp;gt;&lt;/span&gt;pages&lt;span class="nt"&gt;&amp;lt;/TH&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TH&amp;gt;&lt;/span&gt;release_date&lt;span class="nt"&gt;&amp;lt;/TH&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TH&amp;gt;&lt;/span&gt;price&lt;span class="nt"&gt;&amp;lt;/TH&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/TR&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;The Hobbit&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;J.R.R. Tolkien&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;310&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;1937-09-21&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;39.99&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/TR&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;&lt;/span&gt;2&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;The Fellowship of the Ring&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;J.R.R. Tolkien&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;423&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;1954-07-29&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;49.99&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/TR&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;&lt;/span&gt;3&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;The Two Towers&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;J.R.R. Tolkien&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;352&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;1954-11-11&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;49.99&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/TR&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;&lt;/span&gt;4&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;The Return of the King&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;J.R.R. Tolkien&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;416&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;1955-10-20&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;TD&amp;gt;&lt;/span&gt;49.99&lt;span class="nt"&gt;&amp;lt;/TD&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/TR&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Insert
&lt;/h3&gt;

&lt;p&gt;The insert mode simply outputs the result in SQL insert statements. This is really handy for bulk inserting or migrating data across databases or tables.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode insert
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO "table"(id,title,author,pages,release_date,price) VALUES(1,'The Hobbit','J.R.R. Tolkien',310,'1937-09-21',39.99000000000000198);
INSERT INTO "table"(id,title,author,pages,release_date,price) VALUES(2,'The Fellowship of the Ring','J.R.R. Tolkien',423,'1954-07-29',49.99000000000000198);
INSERT INTO "table"(id,title,author,pages,release_date,price) VALUES(3,'The Two Towers','J.R.R. Tolkien',352,'1954-11-11',49.99000000000000198);
INSERT INTO "table"(id,title,author,pages,release_date,price) VALUES(4,'The Return of the King','J.R.R. Tolkien',416,'1955-10-20',49.99000000000000198);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  JSON
&lt;/h3&gt;

&lt;p&gt;The json mode simply outputs the result in json format.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode json
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"The Hobbit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"pages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;310&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"release_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1937-09-21"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;39.99000000000000198&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"The Fellowship of the Ring"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"pages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;423&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"release_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1954-07-29"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;49.99000000000000198&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"The Two Towers"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"pages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;352&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"release_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1954-11-11"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;49.99000000000000198&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"The Return of the King"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"pages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;416&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"release_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1955-10-20"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;49.99000000000000198&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  List (The default)
&lt;/h3&gt;

&lt;p&gt;As we already know, the list mode is the default mode.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode list
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id|title|author|pages|release_date|price
1|The Hobbit|J.R.R. Tolkien|310|1937-09-21|39.99
2|The Fellowship of the Ring|J.R.R. Tolkien|423|1954-07-29|49.99
3|The Two Towers|J.R.R. Tolkien|352|1954-11-11|49.99
4|The Return of the King|J.R.R. Tolkien|416|1955-10-20|49.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Markdown
&lt;/h3&gt;

&lt;p&gt;The markdown mode simply outputs the result in markdown format. We can use this output in a markdown file and it will nicely draw the tables out.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode markdown
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| id |           title            |     author     | pages | release_date | price |
|----|----------------------------|----------------|-------|--------------|-------|
| 1  | The Hobbit                 | J.R.R. Tolkien | 310   | 1937-09-21   | 39.99 |
| 2  | The Fellowship of the Ring | J.R.R. Tolkien | 423   | 1954-07-29   | 49.99 |
| 3  | The Two Towers             | J.R.R. Tolkien | 352   | 1954-11-11   | 49.99 |
| 4  | The Return of the King     | J.R.R. Tolkien | 416   | 1955-10-20   | 49.99 |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Qbox
&lt;/h3&gt;

&lt;p&gt;The qbox mode simply outputs the result in box format with the option as &lt;code&gt;--wrap 60 --quote&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode qbox
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────┬──────────────────────────────┬──────────────────┬───────┬──────────────┬───────┐
│ id │            title             │      author      │ pages │ release_date │ price │
├────┼──────────────────────────────┼──────────────────┼───────┼──────────────┼───────┤
│ 1  │ 'The Hobbit'                 │ 'J.R.R. Tolkien' │ 310   │ '1937-09-21' │ 39.99 │
│ 2  │ 'The Fellowship of the Ring' │ 'J.R.R. Tolkien' │ 423   │ '1954-07-29' │ 49.99 │
│ 3  │ 'The Two Towers'             │ 'J.R.R. Tolkien' │ 352   │ '1954-11-11' │ 49.99 │
│ 4  │ 'The Return of the King'     │ 'J.R.R. Tolkien' │ 416   │ '1955-10-20' │ 49.99 │
└────┴──────────────────────────────┴──────────────────┴───────┴──────────────┴───────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Quote
&lt;/h3&gt;

&lt;p&gt;The quote mode simply outputs the result in SQL-string quote format.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode quote
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'id','title','author','pages','release_date','price'
1,'The Hobbit','J.R.R. Tolkien',310,'1937-09-21',39.99000000000000198
2,'The Fellowship of the Ring','J.R.R. Tolkien',423,'1954-07-29',49.99000000000000198
3,'The Two Towers','J.R.R. Tolkien',352,'1954-11-11',49.99000000000000198
4,'The Return of the King','J.R.R. Tolkien',416,'1955-10-20',49.99000000000000198
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Table
&lt;/h3&gt;

&lt;p&gt;The table mode simply outputs the result in table format. We saw this mode in the previous example.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode table
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----+----------------------------+----------------+-------+--------------+-------+
| id |           title            |     author     | pages | release_date | price |
+----+----------------------------+----------------+-------+--------------+-------+
| 1  | The Hobbit                 | J.R.R. Tolkien | 310   | 1937-09-21   | 39.99 |
| 2  | The Fellowship of the Ring | J.R.R. Tolkien | 423   | 1954-07-29   | 49.99 |
| 3  | The Two Towers             | J.R.R. Tolkien | 352   | 1954-11-11   | 49.99 |
| 4  | The Return of the King     | J.R.R. Tolkien | 416   | 1955-10-20   | 49.99 |
+----+----------------------------+----------------+-------+--------------+-------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Tabs
&lt;/h3&gt;

&lt;p&gt;The tabs mode simply outputs the result in tab-separated values.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode tabs
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id      title   author  pages   release_date    price
1       The Hobbit      J.R.R. Tolkien  310     1937-09-21      39.99
2       The Fellowship of the Ring      J.R.R. Tolkien  423     1954-07-29      49.99
3       The Two Towers  J.R.R. Tolkien  352     1954-11-11      49.99
4       The Return of the King  J.R.R. Tolkien  416     1955-10-20      49.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Tcl
&lt;/h3&gt;

&lt;p&gt;The Tcl mode simply outputs the result in Tcl format. Tcl or tool command language is a configuration friendly format.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mode tcl
SELECT * FROM books;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tcl"&gt;&lt;code&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt; &lt;span class="s2"&gt;"title"&lt;/span&gt; &lt;span class="s2"&gt;"author"&lt;/span&gt; &lt;span class="s2"&gt;"pages"&lt;/span&gt; &lt;span class="s2"&gt;"release_date"&lt;/span&gt; &lt;span class="s2"&gt;"price"&lt;/span&gt;
&lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="s2"&gt;"The Hobbit"&lt;/span&gt; &lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt; &lt;span class="s2"&gt;"310"&lt;/span&gt; &lt;span class="s2"&gt;"1937-09-21"&lt;/span&gt; &lt;span class="s2"&gt;"39.99"&lt;/span&gt;
&lt;span class="s2"&gt;"2"&lt;/span&gt; &lt;span class="s2"&gt;"The Fellowship of the Ring"&lt;/span&gt; &lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt; &lt;span class="s2"&gt;"423"&lt;/span&gt; &lt;span class="s2"&gt;"1954-07-29"&lt;/span&gt; &lt;span class="s2"&gt;"49.99"&lt;/span&gt;
&lt;span class="s2"&gt;"3"&lt;/span&gt; &lt;span class="s2"&gt;"The Two Towers"&lt;/span&gt; &lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt; &lt;span class="s2"&gt;"352"&lt;/span&gt; &lt;span class="s2"&gt;"1954-11-11"&lt;/span&gt; &lt;span class="s2"&gt;"49.99"&lt;/span&gt;
&lt;span class="s2"&gt;"4"&lt;/span&gt; &lt;span class="s2"&gt;"The Return of the King"&lt;/span&gt; &lt;span class="s2"&gt;"J.R.R. Tolkien"&lt;/span&gt; &lt;span class="s2"&gt;"416"&lt;/span&gt; &lt;span class="s2"&gt;"1955-10-20"&lt;/span&gt; &lt;span class="s2"&gt;"49.99"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-mode-dot-command/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-mode-dot-command/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-mode-dot-command/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: Output mode | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Output mode dot command The SQLite shell is a great way to test out and run bunch of queries, but the output might be squished or cluttered. You might need to v
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite dot commands: change directory command</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Thu, 18 Sep 2025 18:15:36 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-change-directory-command-n6g</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-change-directory-command-n6g</guid>
      <description>&lt;h2&gt;
  
  
  Change directory dot command
&lt;/h2&gt;

&lt;p&gt;If you are in a sqlite shell and forgot to change directory or want to navigate to a separate directory, you can do that with the &lt;code&gt;.cd&lt;/code&gt; dot command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.cd /path/to/directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is better than doing &lt;code&gt;.shell cd /path/to/directory&lt;/code&gt; because it doesn't open a separate terminal process. So, the &lt;code&gt;.cd&lt;/code&gt; is persistant throughout the session, whereas the &lt;code&gt;.shell cd &amp;lt;path&amp;gt;&lt;/code&gt; will only within that command (subprocess).&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.cd&lt;/code&gt; command changes the working directory of the SQLite shell itself, so the change persists for the rest of the session. This means commands like &lt;code&gt;.import&lt;/code&gt;, &lt;code&gt;.read&lt;/code&gt;, or &lt;code&gt;.output&lt;/code&gt; will automatically look for files in the new directory.&lt;/p&gt;

&lt;p&gt;However, &lt;code&gt;.shell cd &amp;lt;path&amp;gt;&lt;/code&gt; spawns a separate subprocess, and the directory change is discarded as soon as that command finishes. It does not affect SQLite’s own state of the current directory.&lt;/p&gt;

&lt;p&gt;So if you plan to read or write multiple files from a different location during your SQLite session, prefer the built-in &lt;code&gt;.cd&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-cd-dot-command/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-cd-dot-command/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-cd-dot-command/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: change directory command | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Change directory dot command If you are in a sqlite shell and forgot to change directory or want to navigate to a separate directory, you can do that with the d
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite dot commands: run system shell commands</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Tue, 16 Sep 2025 16:41:52 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-run-system-shell-commands-3ao4</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-run-system-shell-commands-3ao4</guid>
      <description>&lt;h2&gt;
  
  
  Shell dot command
&lt;/h2&gt;

&lt;p&gt;If you are in middle of a sqlite shell session, and you don't want to quit the shell to run arbitrary shell command, you can simply use the &lt;code&gt;.shell &amp;lt;command&amp;gt;&lt;/code&gt; to execute any shell commands right from within the sqlite shell. How handy is this!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.shell echo "hello, world!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That is a lame example, but it shows you the power of the &lt;code&gt;.shell&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Let's say I want to run a golang project, I can do this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.shell go run main.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Its helpful if you want to do something but you don't want to quit the shell to do that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;look up few files/datapoints from the local filesystem,&lt;/li&gt;
&lt;li&gt;run scripts to populate data&lt;/li&gt;
&lt;li&gt;populate database and then reopen the db shell&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is are the things that I have stumbled upon, so far. Need more experience to see if there are more.&lt;/p&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-shell-dot-command/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-shell-dot-command/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-shell-dot-command/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: run system shell commands | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Shell dot command If you are in middle of a sqlite shell session, and you don't want to quit the shell to run arbitrary shell command, you can simply use the to
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite dot commands: read command is recursive?</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Mon, 15 Sep 2025 17:54:19 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-read-command-is-recursive-2358</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-read-command-is-recursive-2358</guid>
      <description>&lt;p&gt;Yesterday, while exploring the &lt;code&gt;.read&lt;/code&gt; command I discovered a little hack.&lt;/p&gt;

&lt;p&gt;We know you can read arbitrary sqlite shell commands from the &lt;code&gt;.read |&lt;/code&gt; operator, even the dot commands.&lt;/p&gt;

&lt;p&gt;So, you can even use &lt;code&gt;.read&lt;/code&gt; itself again. Which means we can call the same file to read inside the script.&lt;/p&gt;

&lt;p&gt;Ops!&lt;/p&gt;

&lt;p&gt;Let's create a file called &lt;code&gt;loop.sh&lt;/code&gt; this will emit certain valid sql/sqlite commands like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"SELECT 'hello, world!';"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;".read |./loop.sh"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The first will print out "SELECT 'hello world!';" so when directed to the shell, it will be executed and print "hello, world!"&lt;/p&gt;

&lt;p&gt;Then the 3rd line &lt;code&gt;echo ".read |./loop.sh"&lt;/code&gt; is the magic, it will execute the script again right?&lt;/p&gt;

&lt;p&gt;Because it's a valid sqlite shell command and it will execute it. It will take the read command and print everything when executing the &lt;code&gt;loop.sh&lt;/code&gt; shell script.&lt;/p&gt;

&lt;p&gt;What's the output?&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;loop.sh
&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"SELECT 'hello, world!';"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;".read |./loop.sh"&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;sqlite3
SQLite version 3.50.4 2025-07-30 19:33:53
Enter &lt;span class="s2"&gt;".help"&lt;/span&gt; &lt;span class="k"&gt;for &lt;/span&gt;usage hints.
Connected to a transient &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="nt"&gt;-memory&lt;/span&gt; database.
Use &lt;span class="s2"&gt;".open FILENAME"&lt;/span&gt; to reopen on a persistent database.
sqlite&amp;gt; .read |./loop.sh
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
hello, world!
Input nesting limit &lt;span class="o"&gt;(&lt;/span&gt;25&lt;span class="o"&gt;)&lt;/span&gt; reached at line 2. Check recursion.
sqlite&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Well, SQLite developers are smarter to handle the edge case I think. :)&lt;/p&gt;

&lt;p&gt;This is a little fun, but it's kind of a quirk, an not-so easter egg but interesting thing to know.&lt;/p&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-read-dot-command-is-recursive/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-read-dot-command-is-recursive/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-read-dot-command-is-recursive/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: read command is recursive? | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Yesterday, while exploring the command I discovered a little hack. We know you can read arbitrary sqlite shell commands from the operator, even the dot commands
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite dot commands: read file or standard output</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Sun, 14 Sep 2025 10:58:25 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-read-file-or-standard-output-p0m</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-read-file-or-standard-output-p0m</guid>
      <description>&lt;h2&gt;
  
  
  Read dot Command
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;.read&lt;/code&gt; dot command is a quick handy command to import and run your SQL queries in the current session.&lt;/p&gt;

&lt;p&gt;You can just pass a SQL file (usually a query ending with ; it will execute each query one by one)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;.read filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let’s say this is a sql file containing the schema of a database, just one table users.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;   &lt;span class="nb"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Writing this sql query in the &lt;code&gt;schema.sql&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;If we use the .read command with the name of the file it will execute it line by line, (line meaning terminated by ; here or even any dot commands)&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;.read schema.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will just execute the query, if there are SELECT statements possibly then will output the result set too.&lt;/p&gt;

&lt;p&gt;Let’s add some users to the table with the &lt;code&gt;insert_users.sql&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'abc'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'def'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'ghi'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Saving this and running .read insert_users.sql should now have displayed all the 3 inserted users. &lt;/p&gt;
&lt;h2&gt;
  
  
  Reading with dot commands
&lt;/h2&gt;

&lt;p&gt;Let’s create one more file with specific dot commands to render a nice table format of a result set from a select statement&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;mode&lt;/span&gt; &lt;span class="k"&gt;table&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I save the above contents into a file called &lt;code&gt;users.sql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now if I run the .read command with the users.sql you should see all your users but with the mode as table format. It even takes the dot commands and all of the nice options out there. Be cautious though!&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.read users.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlite&amp;gt; .read users.sql
+----+---------+
| id |  name   |
+----+---------+
| 1  | User_1  |
| 2  | User_2  |
| 3  | User_3  |
| 4  | User_4  |
| 5  | User_5  |
| 6  | User_6  |
| 7  | User_7  |
| 8  | User_8  |
| 9  | User_9  |
| 10 | User_10 |
+----+---------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Read with standard output
&lt;/h2&gt;

&lt;p&gt;You can also run a script that will generate some SQL commands and execute them. By using the | operator after .read and providing the name of the script. this will run the script and any output of that script (valid sql) will be executed on the shell.&lt;/p&gt;

&lt;p&gt;For instance I have a script that would insert 10 users with a bash script like so called &lt;code&gt;inser_users.sh&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;1 10&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"INSERT INTO users (name) VALUES ('User_&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;');"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you would use this as is it won’t work as its a bash script, you can’t run those in a sqlite shell. However by using &lt;code&gt;.read | filename&lt;/code&gt; (shell script), that will indeed do the trick.&lt;/p&gt;

&lt;p&gt;The important thing to note here is that it would run all the things outputted from the script, so its kind of running the script and the std out of that script is taken as the input for the read command so like typical pipe operator in linux.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.read | insert_users.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will run the script and the insert statements will be printed, so it will execute them. So, in essence we are basically piping the output of one command to the other in this case the read command.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see it has now inserted all the 10 users.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;|&lt;/code&gt; command can be followed by any script, not limited to bash, it could be python, or any script or program that can print to the standard output a correct and legal SQL statements.&lt;/p&gt;

&lt;p&gt;This is a really great small yet highly important piece of functionality of sqlite shell.&lt;/p&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://sqlite.org/cli.html#reading_sql_from_a_file" rel="noopener noreferrer"&gt;SQLite CLI: Reading SQL from a File&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-dot-commands-read-file-or-standard-output/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-dot-commands-read-file-or-standard-output/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-dot-commands-read-file-or-standard-output/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: read file or standard output | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Read dot Command The dot command is a quick handy command to import and run your SQL queries in the current session. You can just pass a SQL file (usually a que
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sqlite</category>
      <category>sql</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite Scalar function: 3 valued iif and if scalar function</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Sat, 13 Sep 2025 14:34:45 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-scalar-function-3-valued-iif-and-if-scalar-function-22cd</link>
      <guid>https://dev.to/mr_destructive/sqlite-scalar-function-3-valued-iif-and-if-scalar-function-22cd</guid>
      <description>&lt;p&gt;In the recent SQLite version specifically the 3.48.0, the support for pair of conditions was added to the iif function. And also an alias for iif as if was added for compatibility and ease of use for people coming from other databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  IIF Before 3.48
&lt;/h2&gt;

&lt;p&gt;Before this release it was kind of 3 way /ternary operation kind of thing like this&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple IF THEN ELSE
&lt;/h3&gt;

&lt;p&gt;We can use the IIF function by passing 3 paraeters, first is the condition to check, the second is the value to return if the condition is true and the third is the value to return if the condition is false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'one is zero'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'one is not zero'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;one is not zero
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Ternary like nested IIF
&lt;/h3&gt;

&lt;p&gt;Optionally the third condition can be nested with another IIF as it will be a value in the end. So, we can use IIF like this&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'even'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'multiple of 3'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'prime'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;is_prime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+---------+
| is_prime|
+---------+
| prime   |
+---------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That is quite simple but it gets little messed up for more than one check, take this for instance&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;  &lt;span class="n"&gt;is_leap_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------+
| is_leap_year |
+--------------+
| not leap     |
+--------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I have printed it in a nice way, but still might get harder to read and even write, notice the number of closing brackets at the end.&lt;/p&gt;
&lt;h2&gt;
  
  
  IIF After 3.48
&lt;/h2&gt;

&lt;p&gt;With the latest 3.48 version, this changes quite a bit, you can have iif or if as like a case when then replacement like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;is_leap_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------+
| is_leap_year |
+--------------+
| not leap     |
+--------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;How clean is that, with this you can specify, Condition, Value as a pair and it can have N subsequent pairs of this condition - value.  All and this while maintaining backwards compatibility, that’s quite a remarkable thing to push I would say, not easy to handle these.&lt;/p&gt;

&lt;p&gt;Now it has 3 variants&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 valued expression (single expression, could be nested too, but three expressions, like →  condition, true, false)&lt;/li&gt;
&lt;li&gt;2 valued expression (assumes the false value is NULL)&lt;/li&gt;
&lt;li&gt;N condition - valued pair expression (two pair of condition and value)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These is neat and makes a lot of sense.&lt;/p&gt;

&lt;p&gt;Let’s see the same example in all 3 variants&lt;/p&gt;
&lt;h3&gt;
  
  
  3 Valued Expression
&lt;/h3&gt;

&lt;p&gt;This is the most simple one&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'probably leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;is_leap_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------+
| is_leap_year |
+--------------+
| not leap     |
+--------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This returned the false value which happens when the condition evaluated to false.&lt;/p&gt;
&lt;h3&gt;
  
  
  2 Valued Expression
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'probably leap'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;is_leap_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------+
| is_leap_year |
+--------------+
|              |
+--------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This returned NULL as 2025 is not divisible by 4. If there are 2N parameters to the function, and if all the conditions are false, it will return NULL. And the above example is the base case of it. Remember to have atleast 2 parameters, one the condition and one as the value if that condition evaluates to true. The last parameter is optional and if the condition is false, it would return NULL.&lt;/p&gt;
&lt;h3&gt;
  
  
  N Pair Expression
&lt;/h3&gt;

&lt;p&gt;So moving on the final one which is the most readable version of it and allows more stuff&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;iif&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="mi"&gt;2025&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'leap'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="s1"&gt;'not leap'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="s1"&gt;' year'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;is_leap_year&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+---------------+
| is_leap_year  |
+---------------+
| not leap year |
+---------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Elegant&lt;br&gt;
Notice the last condition, if you don’t specify that, it will be NULL, so it would be 2N+1 parameters (where N is the number of conditions)&lt;/p&gt;

&lt;p&gt;Other way to remember is &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Even parameters and all conditions are

&lt;ul&gt;
&lt;li&gt;True (the first value) or equivalent corresponding value for that condition&lt;/li&gt;
&lt;li&gt;False (it will return NULL)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Odd parameters and all conditions are 

&lt;ul&gt;
&lt;li&gt;True (the first value) or equivalent corresponding value for that condition&lt;/li&gt;
&lt;li&gt;False (it will return the last parameter which is the false condition)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use iif or if interchangeably. Both these do the same thing as the CASE WHEN THEN conditions, I think IIF now is really easy to write as now it supports arguments in pairs.&lt;/p&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-iff-if-scalar-functions/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-iff-if-scalar-functions/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-iff-if-scalar-functions/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite Scalar function: 3 valued iif and if scalar function | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            In the recent SQLite version specifically the 3.48.0, the support for pair of conditions was added to the iif function. And also an alias for iif as if was adde
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>SQLite functions: unistr and unistr quote</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Fri, 12 Sep 2025 16:37:01 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-functions-unistr-and-unistr-quote-cb0</link>
      <guid>https://dev.to/mr_destructive/sqlite-functions-unistr-and-unistr-quote-cb0</guid>
      <description>&lt;p&gt;SQLite &lt;a href="https://www.sqlite.org/releaselog/3_50_0.html" rel="noopener noreferrer"&gt;3.50&lt;/a&gt; introduced &lt;a href="https://www.sqlite.org/lang_corefunc.html#unistr" rel="noopener noreferrer"&gt;unistr&lt;/a&gt; and &lt;a href="https://www.sqlite.org/lang_corefunc.html#unistr_quote" rel="noopener noreferrer"&gt;unistr_quote&lt;/a&gt; functions&lt;/p&gt;

&lt;p&gt;These are for taking in escape sequences and returning the actual unicode string like emoji or other non-english characters outside the ascii convention forming the utf-8 character set&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;unistr&lt;/code&gt; is used to take in the escape sequences and return the actual unicode string&lt;br&gt;
The &lt;code&gt;unistr_quote&lt;/code&gt; is used to escape those escape sequences in a sql query so your data can be stored with emojis.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I wonder these functions were added because of LLMs emoji-heavy outputs?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s how you use unistr in a simple query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;unistr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\u&lt;/span&gt;&lt;span class="s1"&gt;2665, &lt;/span&gt;&lt;span class="se"&gt;\U&lt;/span&gt;&lt;span class="s1"&gt;0001F600'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;This will print the :heart and :smiley emojis&lt;/p&gt;

&lt;p&gt;I won’t print the emojis, it might look like a AI-generated post (grunts with pride)&lt;/p&gt;

&lt;p&gt;This is handy to render the values but first you need to get the values stored in the db, for that you need to have it like a string i.e. escaped string&lt;/p&gt;

&lt;p&gt;That is where the &lt;code&gt;unistr_quote comes&lt;/code&gt; in&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;sql&lt;br&gt;
SELECT unistr_quote('\U0001F600');&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will simply print '\U0001F600' notice the quotes here, it will be a escaped character sequence making it like a special string in middle of a string,&lt;/p&gt;

&lt;p&gt;so if we have something like this&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;sql&lt;br&gt;
SELECT printf('what the heck is this%s symbol?', unistr_quote('\U0001F449'));&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;output: what the heck is this'\U0001F449' symbol?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This will make the distinction clear, we get a quoted string for that special set of characters or escape sequence which can be useful if the storage medium would make storing emojis obsolete.&lt;/p&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-functions-unistr-and-unistr-quote/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-functions-unistr-and-unistr-quote/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-functions-unistr-and-unistr-quote/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite functions: unistr and unistr_quote | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            SQLite introduced and functions These are for taking in escape sequences and returning the actual unicode string like emoji or other non-english characters outs
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sqlite</category>
      <category>sql</category>
      <category>database</category>
      <category>backend</category>
    </item>
    <item>
      <title>True, we can also have empathy on the maintainers because with all of this AI slop, people. start spamming the project too. It might be a miatake in this case, but can relate why the friction is added, to sift out the genuine ones. It might back fire too</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Fri, 12 Sep 2025 11:54:13 +0000</pubDate>
      <link>https://dev.to/mr_destructive/true-we-can-also-have-empathy-on-rhe-maintainers-because-with-all-of-this-ai-slop-people-start-1adk</link>
      <guid>https://dev.to/mr_destructive/true-we-can-also-have-empathy-on-rhe-maintainers-because-with-all-of-this-ai-slop-people-start-1adk</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/jankapunkt/wasted-open-source-efforts-8ia" class="crayons-story__hidden-navigation-link"&gt;Wasted Open Source efforts 😮&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/jankapunkt" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F157294%2F1c3c63fd-d0d4-4db4-97ca-2a3d825ece7c.jpeg" alt="jankapunkt profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/jankapunkt" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Jan Küster 🔥
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Jan Küster 🔥
                
              
              &lt;div id="story-author-preview-content-2835969" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/jankapunkt" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F157294%2F1c3c63fd-d0d4-4db4-97ca-2a3d825ece7c.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Jan Küster 🔥&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/jankapunkt/wasted-open-source-efforts-8ia" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Sep 10 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/jankapunkt/wasted-open-source-efforts-8ia" id="article-link-2835969"&gt;
          Wasted Open Source efforts 😮
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/productivity"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;productivity&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/github"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;github&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/jankapunkt/wasted-open-source-efforts-8ia" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;55&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/jankapunkt/wasted-open-source-efforts-8ia#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              16&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>opensource</category>
      <category>productivity</category>
      <category>python</category>
      <category>github</category>
    </item>
    <item>
      <title>SQLite dot commands: html tables with output and once</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Thu, 11 Sep 2025 18:28:12 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-dot-commands-html-tables-with-output-and-once-1c24</link>
      <guid>https://dev.to/mr_destructive/sqlite-dot-commands-html-tables-with-output-and-once-1c24</guid>
      <description>&lt;p&gt;The &lt;code&gt;.once -w&lt;/code&gt; or &lt;code&gt;.www&lt;/code&gt; was released in &lt;a href="https://www.sqlite.org/releaselog/3_47_0.html" rel="noopener noreferrer"&gt;SQLite 3.47&lt;/a&gt; release last year.&lt;/p&gt;

&lt;p&gt;I was trying this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;.once &lt;span class="nt"&gt;-w&lt;/span&gt; results.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;But was getting an error that it was not a valid argument, and the .www command doesn’t exist. I saw the git repo and found the source code and found out that it was released in the recent version. My laptop had SQLite 3.37 version installed.&lt;/p&gt;

&lt;p&gt;I ran a docker image of sqlite to the latest version and check out the working of that .www command or .once -w subcommand option.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is .once -w or .output -w or .www
&lt;/h2&gt;

&lt;p&gt;All of these are equivalent&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.once -w&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.www&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The output is just for all the subsequent commands to be saved in a file, whereas the &lt;code&gt;.once -w&lt;/code&gt; and &lt;code&gt;.www&lt;/code&gt; are only for the next one query.&lt;/p&gt;

&lt;p&gt;This command basically allows the resultset to be saved in a html format/file. Note that you cannot specify a file, it will be stored in a temporary file, and if that is accesible and readable to the browser and enough permissions are set to the temp folder (whatever that is for linux and windows or mac), it should render an html page (its simple)&lt;/p&gt;

&lt;p&gt;However, if you are thinking of getting some specific file to write the results then you need to do some work&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.output result.html
.print '&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;TABLE border="1" cellspacing="0" cellpadding="2"&amp;gt;'
.mode html
.headers on
SELECT abs(random()%10)+1 as "some numbers", 'number' from generate_series(1,10);
.print '&amp;lt;/table&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will store the html document in the result.html with proper tags and semantics not just the table element&lt;/p&gt;

&lt;p&gt;Phew! That might not be a lot, but that is the thing, the .mode html will only get you the table element but it wont render properly, browsers won’t be able to read the raw html elemetnts without the html doctype tags.&lt;/p&gt;

&lt;p&gt;Read the entire blog post &lt;a href="https://www.meetgor.com/sqlog/sqlite-dot-commands-html-tables-with-output-and-once/" rel="noopener noreferrer"&gt;here&lt;/a&gt; with interactive SQL codeblocks and playground like environment &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-dot-commands-html-tables-with-output-and-once/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-dot-commands-html-tables-with-output-and-once/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite dot commands: html tables with output and once | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            The or was released in release last year. I was trying this command But was getting an error that it was not a valid argument, and the .www command doesn’t ex
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
    </item>
    <item>
      <title>SQLite: Randomly order rows</title>
      <dc:creator>Meet Rajesh Gor</dc:creator>
      <pubDate>Wed, 10 Sep 2025 17:30:46 +0000</pubDate>
      <link>https://dev.to/mr_destructive/sqlite-randomly-order-rows-1pac</link>
      <guid>https://dev.to/mr_destructive/sqlite-randomly-order-rows-1pac</guid>
      <description>&lt;p&gt;Return rows or records in a table with random order in SQLite&lt;/p&gt;

&lt;p&gt;Let's take a simple table for this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="n"&gt;AUTOINCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'abc'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'def'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'ghi'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'jkl'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'mno'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will return the rows in a random order&lt;/p&gt;

&lt;p&gt;You can limit the number of rows&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We can even randomly shuffle a subset of rows with limit and where clauses&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;limit&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is cool if you want to get certain subset of samples but in no strict order.&lt;/p&gt;

&lt;p&gt;Read the full post with interactive SQL codeblocks and playground like environment &lt;a href="https://www.meetgor.com/sqlog/sqlite-randomly-order-rows/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-randomly-order-rows/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.meetgor.com/sqlog/sqlite-randomly-order-rows/" rel="noopener noreferrer" class="c-link"&gt;
            SQLite: Randomly order rows | Meet Gor
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Return rows or records in a table with random order in SQLite Let's take a simple table for this: This will return the rows in a random order You can limit the
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.meetgor.com%2Fmgicon.png"&gt;
          meetgor.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>sql</category>
      <category>sqlite</category>
      <category>database</category>
    </item>
  </channel>
</rss>
