<?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: Dhawal Singh Panwar</title>
    <description>The latest articles on DEV Community by Dhawal Singh Panwar (@dspsolves).</description>
    <link>https://dev.to/dspsolves</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%2F249914%2F5beeb979-3774-4c6c-b957-9667e25ad7f2.jpg</url>
      <title>DEV Community: Dhawal Singh Panwar</title>
      <link>https://dev.to/dspsolves</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dspsolves"/>
    <language>en</language>
    <item>
      <title>How many rows would have been there without that LIMIT clause?</title>
      <dc:creator>Dhawal Singh Panwar</dc:creator>
      <pubDate>Sat, 14 Aug 2021 15:10:15 +0000</pubDate>
      <link>https://dev.to/dspsolves/how-many-rows-would-have-been-there-without-that-limit-clause-4adl</link>
      <guid>https://dev.to/dspsolves/how-many-rows-would-have-been-there-without-that-limit-clause-4adl</guid>
      <description>&lt;p&gt;You're familiar with the concept of modularity from OOPS, right? So, my introduction is not in this post. 😆&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Explanation

&lt;ul&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;Postgres&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;li&gt;Further Reads&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Let's say, you're building this software for an event management company to keep a track of all their events digitally. So, you have the front-end dev ready with the UI and all she needs from you is two things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A list of all events that have already happened this year (10 rows at a time for the sake of pagination)&lt;/li&gt;
&lt;li&gt;Total count of the same&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Considering that there's an &lt;code&gt;events&lt;/code&gt; table in your SQL Database, you could just get down to coding and provide two separate endpoints to accommodate her requirements.&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;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&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;10&lt;/span&gt; &lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above query will serve you with the requirements of Task 1 in getting the desired details in a paginated manner given you provide a limit and an offset according to however many records the user wants to see on the GUI at a time.&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="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&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;total&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And, this query will get you the total number of records there exist that match the provided condition.&lt;/p&gt;

&lt;p&gt;This will suffice her requirements and also you'll have her impressed with how quickly you can implement this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/1rM1PgQL5R9BBm4Juc/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/1rM1PgQL5R9BBm4Juc/giphy.gif" alt="there's more" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Explanation
&lt;/h2&gt;

&lt;p&gt;Let's consider the following queries you'd write.&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;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&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;10&lt;/span&gt; &lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------+--------------+----------+----------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------+--------------+----------+----------------+&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;6&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;5&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;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;05&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;6&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;7&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&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;1&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;8&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;10&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&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;13&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;08&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;            &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;        &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;28&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;12&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;4&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;19&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;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;26&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;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------+--------------+----------+----------------+&lt;/span&gt;
&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt; &lt;span class="n"&gt;sec&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="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&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;total&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;54&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------+&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;What'll happen in the first query is that the SQL Server will gather all the rows that satisfy the &lt;code&gt;WHERE&lt;/code&gt; clause like in a one big superset and then return you the quantity mentioned in the &lt;code&gt;LIMIT&lt;/code&gt; clause. This is completely fine.&lt;/p&gt;

&lt;p&gt;But, where things go not so good for the server is when it'll run the second query. It'll again do the same steps as it did in the first query, make a superset and then count it for you.&lt;/p&gt;

&lt;p&gt;So, it'll do the same thing, evaluate your whole query just to get you a total count? Isn't that overkill?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/XGIzbeBBuzSmBFWVNM/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/XGIzbeBBuzSmBFWVNM/giphy.gif" alt="umm, yeah" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, how about another way of achieving the said tasks without burdening the SQL Server?&lt;/p&gt;

&lt;p&gt;So, some SQL solutions provide you ways out of this. Let me show you how you could do this in an efficient manner for MySQL and Postgres.&lt;/p&gt;
&lt;h3&gt;
  
  
  MySQL
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;SQL_CALC_FOUND_ROWS&lt;/code&gt; is a query modifier or say its just a keyword like &lt;code&gt;DISTINCT&lt;/code&gt; which you use in conjunction with the &lt;code&gt;SELECT&lt;/code&gt; 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="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;SQL_CALC_FOUND_ROWS&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&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;10&lt;/span&gt; &lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------+--------------+----------+----------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------+--------------+----------+----------------+&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;6&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;5&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;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;05&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;6&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;7&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&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;1&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;8&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;10&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&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;13&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;08&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;            &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;        &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;28&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;12&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;4&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;19&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;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;26&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;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------+--------------+----------+----------------+&lt;/span&gt;
&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;warning&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The results look the same. But, what'll happen here is that between making a superset and returning you the &lt;code&gt;LIMIT&lt;/code&gt;ed records, SQL engine will count it all and store the count in the memory somewhere. Well, how does one access it?&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;FOUND_ROWS&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;total&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;54&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------+&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;warning&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Running the above query just after any query which has used the &lt;code&gt;SQL_CALC_FOUND_ROWS&lt;/code&gt; query modifier will return the count it stored while processing the previous query. Thus, its quicker than evaluating the whole query again without the &lt;code&gt;LIMIT&lt;/code&gt; clause. 😄&lt;/p&gt;

&lt;p&gt;Although &lt;a href="https://dev.mysql.com/worklog/task/?id=12615"&gt;MySQL deprecated this feature&lt;/a&gt; due to performance issues, you can still use it till they actually remove it.&lt;/p&gt;
&lt;h3&gt;
  
  
  Postgres
&lt;/h3&gt;

&lt;p&gt;For this particular case the initial queries won't change.&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;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&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;10&lt;/span&gt; &lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt;
&lt;span class="c1"&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;6&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;
  &lt;span class="mi"&gt;5&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;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;05&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;
  &lt;span class="mi"&gt;6&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;7&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;14&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;1&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;
  &lt;span class="mi"&gt;8&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;10&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;
 &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&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;13&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;08&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;
 &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;            &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;        &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;28&lt;/span&gt;
 &lt;span class="mi"&gt;12&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;4&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;
 &lt;span class="mi"&gt;19&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;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;
 &lt;span class="mi"&gt;26&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;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;rows&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="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&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;total&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

 &lt;span class="n"&gt;total&lt;/span&gt;
&lt;span class="c1"&gt;-------&lt;/span&gt;
    &lt;span class="mi"&gt;54&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Same thing will happen here, as well. The &lt;code&gt;WHERE&lt;/code&gt; clause would be required to get evaluated twice.&lt;/p&gt;

&lt;p&gt;However, Postgres offers this concept of &lt;a href="https://www.postgresql.org/docs/9.1/tutorial-window.html"&gt;window functions&lt;/a&gt; which you could use to achieve both the tasks in a single query itself.&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;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&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;total_count&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;NOW&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;10&lt;/span&gt; &lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;organiser_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;venue_id&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;scheduled_date&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;total_count&lt;/span&gt;
&lt;span class="c1"&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;6&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
  &lt;span class="mi"&gt;5&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;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;05&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
  &lt;span class="mi"&gt;6&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;7&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&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;1&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;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
  &lt;span class="mi"&gt;8&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;10&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;06&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
 &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&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;13&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;08&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
 &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;            &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;        &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;28&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
 &lt;span class="mi"&gt;12&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;4&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
 &lt;span class="mi"&gt;19&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;5&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
 &lt;span class="mi"&gt;26&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;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;02&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="mi"&gt;54&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We have used the &lt;code&gt;OVER&lt;/code&gt; clause over here which tells the engine to evaluate the preceding function over those rows that fall in to the same partition as the current row which we can mention in a following &lt;code&gt;PARTITION BY&lt;/code&gt; clause just like how you'd pair up &lt;code&gt;LIMIT&lt;/code&gt; and &lt;code&gt;OFFSET&lt;/code&gt; clauses together.&lt;/p&gt;

&lt;p&gt;We'll cover the &lt;code&gt;PARTITION BY&lt;/code&gt; clause in a future post but in this case, the &lt;code&gt;COUNT(*)&lt;/code&gt; function will be evaluated over all the rows as we have not provided any &lt;code&gt;PARTITION BY&lt;/code&gt; clause to the &lt;code&gt;ORDER&lt;/code&gt; clause like how &lt;code&gt;LIMIT 10 OFFSET 10&lt;/code&gt; returns different output than just &lt;code&gt;LIMIT 10&lt;/code&gt; without any &lt;code&gt;OFFSET&lt;/code&gt; clause.&lt;/p&gt;

&lt;p&gt;Thus, the &lt;code&gt;COUNT(*) OVER ()&lt;/code&gt; will run over all the rows that match the condition specified in the &lt;code&gt;WHERE&lt;/code&gt; clause and be included in the superset which when further gets &lt;code&gt;LIMIT&lt;/code&gt;ed you'll already have a dedicated column holding that total count for you. 😄&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This isn't a &lt;strong&gt;write once use everywhere&lt;/strong&gt; strategy as there will be cases where there are hardly any inserts between multiple paginated selects like this won't be efficient for when I keep refreshing my bank's app constantly when the month begins to see that salary credit record. If my banking institution uses this strategy, its a bad one (for now at least). 😛&lt;/p&gt;

&lt;p&gt;For cases where there are or can be frequent inserts between multiple paginated selects like the bank refreshing my spends history, this is how you can optimize your database process and impress that front-end dev. 😉&lt;/p&gt;
&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.mysql.com/doc/refman/8.0/en/information-functions.html"&gt;MySQL - Information Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postgresql.org/message-id/1185863074.10580.91.camel@linda.lfix.co.uk"&gt;Postgres - SQL_CALC_FOUND_ROWS equivalent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postgresql.org/docs/9.1/tutorial-window.html"&gt;Postgres - Window Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mariadb.com/kb/en/select/#sql_calc_found_rows"&gt;MariaDB - sql_calc_found_rows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mariadb.com/kb/en/found_rows"&gt;MariaDB - found_rows()&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Further Reads
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.mysql.com/worklog/task/?id=12615"&gt;MySQL to deprecate SQL_CALC_FOUND_ROWS and FOUND_ROWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.percona.com/blog/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows"&gt;To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>database</category>
      <category>sql</category>
      <category>mysql</category>
      <category>postgres</category>
    </item>
    <item>
      <title>What the fetch() is an API ?</title>
      <dc:creator>Dhawal Singh Panwar</dc:creator>
      <pubDate>Mon, 07 Sep 2020 16:03:54 +0000</pubDate>
      <link>https://dev.to/dspsolves/what-the-fetch-is-an-api-1n54</link>
      <guid>https://dev.to/dspsolves/what-the-fetch-is-an-api-1n54</guid>
      <description>&lt;p&gt;You're familiar with the concept of modularity from OOPS, right? So, my introduction is not in this post. 😆&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;An application programming interface (API) is a computing interface which defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. - &lt;a href="https://en.wikipedia.org/wiki/API"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There's this fuss about APIs. Everyone has their own definition of what an API is or at least what it's like. But, let me tell you this. Don't trust anyone 🙉&lt;/p&gt;

&lt;h1&gt;
  
  
  Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Explanation

&lt;ul&gt;
&lt;li&gt;The Dictionary Analogy&lt;/li&gt;
&lt;li&gt;The Restaurant Analogy&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;li&gt;Further Reads&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Explanation
&lt;/h1&gt;

&lt;p&gt;There is a &lt;a href="https://www.google.com/search?q=plethora"&gt;plethora&lt;/a&gt; of analogies. Let's break some of them down.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Dictionary Analogy
&lt;/h3&gt;

&lt;p&gt;This one's quite right, that an API is kinda like a dictionary. But, according to &lt;a href="https://en.wikipedia.org/wiki/Dictionary#Types"&gt;Wikipedia&lt;/a&gt;, there are more than 15 types of dictionaries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/25OBBnY9j1uiVDV4lJ/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/25OBBnY9j1uiVDV4lJ/giphy.gif" alt="there it is" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, it's not just &lt;strong&gt;a&lt;/strong&gt; dictionary. It's a &lt;strong&gt;bilingual&lt;/strong&gt; dictionary; the one we use when we travel to a foreign country.&lt;/p&gt;

&lt;p&gt;The dictionary tells us &lt;strong&gt;how to communicate&lt;/strong&gt; with a person who does not understand the language we speak.&lt;/p&gt;

&lt;p&gt;This is very much similar to the articles we find on Google when we search for "what does it mean when a dog wags its tail in a clockwise manner". Those articles tell us &lt;strong&gt;how to understand&lt;/strong&gt; the dog. 😁&lt;/p&gt;

&lt;h3&gt;
  
  
  The Restaurant Analogy
&lt;/h3&gt;

&lt;p&gt;This one might hold true for an &lt;a href="https://developer.chrome.com/apps/app_frameworks"&gt;MVC architecture&lt;/a&gt; but not for an API. Let's see why not.&lt;/p&gt;

&lt;p&gt;What do we do when we go to a restaurant? Do we just walk straight into the kitchen and tell the chef what we would like to have for dinner? Well, I certainly don't. 😆&lt;/p&gt;

&lt;p&gt;The expectations from us guests are, that we let the waiter know what we would like to have and he will take our order and forward it to the chef. The waiter's job is to keep a track of and serve the orders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/l41lQKzFg8T8p7oas/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/l41lQKzFg8T8p7oas/giphy.gif" alt="waiter" width="426" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, the waiter is just a middleman. The actual message is the dish(es) we order. That is the request which we make.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Coming back to the internet.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;GET https://pokeapi.co/api/v2/pokemon/jigglypuff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a request. But how could we know that URL?&lt;/p&gt;

&lt;p&gt;How do you know that the restaurant serves noodles?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/DRfu7BT8ZK1uo/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/DRfu7BT8ZK1uo/giphy.gif" alt="pokeroll" width="500" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Menu Card&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;p&gt;That is the API. We can select which dish would we like and tell the waiter to get it served for us. &lt;em&gt;Remember, he's not the one who cooks it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Similarly, &lt;a href="https://pokeapi.co/docs/v2#pokemon"&gt;this&lt;/a&gt; is an API. It tells us how to talk to the Pokedex and how will it respond to us.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;GET https://pokeapi.co/api/v2/pokemon/&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id &lt;/span&gt;or name&lt;span class="o"&gt;}&lt;/span&gt;/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like that URL has &lt;code&gt;{id or name}&lt;/code&gt; in it to tell us that either we could pass the &lt;code&gt;name&lt;/code&gt; of the pokemon in the URL or its &lt;code&gt;id&lt;/code&gt;, some restaurants also provide us with methods to order, either we could call them or walk-in.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/amrNGnZUeWhZC/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/amrNGnZUeWhZC/giphy.gif" alt="happy ash" width="400" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Documentation is important. Developers actually use those. 😁&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/API"&gt;Application Programming Interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.chrome.com/apps/app_frameworks"&gt;MVC Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pokemon.com/us/pokedex"&gt;Pokedex&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pokeapi.co/docs/v2"&gt;PokeAPI v2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Further Reads
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dsp9107/understanding-the-simple-express-app-node-js-10j5"&gt;Understanding a Simple Express Server App | Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dsp9107/interacting-with-the-simple-express-app-using-postman-594m"&gt;Interacting with a Simple Express Server App | Postman&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://english.stackexchange.com/questions/103176/there-is-a-plethora-or-there-are-a-plethora"&gt;"is a plethora" or "are a plethora"?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>api</category>
      <category>explained</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding the Simple Express App | Node.js</title>
      <dc:creator>Dhawal Singh Panwar</dc:creator>
      <pubDate>Mon, 31 Aug 2020 18:15:06 +0000</pubDate>
      <link>https://dev.to/dspsolves/understanding-the-simple-express-app-node-js-10j5</link>
      <guid>https://dev.to/dspsolves/understanding-the-simple-express-app-node-js-10j5</guid>
      <description>&lt;p&gt;You're familiar with the concept of modularity from OOPS, right? So, my introduction is not in this post. 😆&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Express is a framework which makes it quite easy to build an API rapidly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.&lt;/p&gt;

&lt;p&gt;With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agenda is to understand each line of code it took to develop the &lt;a href="https://github.com/dsp9107/Simple-Express-App"&gt;Simple Express App&lt;/a&gt; 🌱&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dspsolves"&gt;
        dspsolves
      &lt;/a&gt; / &lt;a href="https://github.com/dspsolves/Simple-Express-App"&gt;
        Simple-Express-App
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A very simple Express app for demonstration purposes.
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Setup

&lt;ul&gt;
&lt;li&gt;Windows&lt;/li&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Usage

&lt;ul&gt;
&lt;li&gt;Starting the Server&lt;/li&gt;
&lt;li&gt;Interacting with the Server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Explanation&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;li&gt;Further Reads&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Setup
&lt;/h1&gt;

&lt;p&gt;Before getting down to the development part, let's set up our development environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Get &lt;a href="https://code.visualstudio.com/download"&gt;VS Code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get &lt;a href="https://nodejs.org/en/download"&gt;Node.js&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download &lt;a href="https://github.com/dsp9107/Simple-Express-App"&gt;Simple Express App&lt;/a&gt; by clicking here : &lt;a href="https://github.com/dsp9107/Simple-Express-App/archive/master.zip"&gt;⬇️&lt;/a&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dspsolves"&gt;
        dspsolves
      &lt;/a&gt; / &lt;a href="https://github.com/dspsolves/Simple-Express-App"&gt;
        Simple-Express-App
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A very simple Express app for demonstration purposes.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Simple Express App&lt;/h1&gt;
&lt;p&gt;Use &lt;a href="https://github.com/dsp9107/Simple-Express-App"&gt;this app&lt;/a&gt; with &lt;a href="https://dev.to/dspsolves/understanding-the-simple-express-app-node-js-10j5" rel="nofollow"&gt;this article&lt;/a&gt; to understand each line of code it takes to set up a basic API with an Express App on Node.js 🌱&lt;/p&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;p&gt;An &lt;code&gt;npm install&lt;/code&gt; is all it takes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tutorial&lt;/strong&gt; - Check out &lt;a href="https://dev.to/dspsolves/understanding-the-simple-express-app-node-js-10j5" rel="nofollow"&gt;this dev post&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt; - Check out &lt;a href="https://gist.github.com/dspsolves/07cb6b779c016f29c93c6606414961e3"&gt;this gist&lt;/a&gt;!&lt;/p&gt;
&lt;h2&gt;
Documentation&lt;/h2&gt;
&lt;p&gt;These are the available open routes.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dspsolves/Simple-Express-App./api/queryParams.md"&gt;queryParams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dspsolves/Simple-Express-App./api/bodyJSON.md"&gt;bodyJSON&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/dspsolves/Simple-Express-App./api/pathVars.md"&gt;pathVars&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dspsolves/Simple-Express-App"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Unzip it and open the folder in VS Code for a convenient experience 😁&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install VS Code
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install --classic code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Install Node.js and npm
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Clone &lt;a href="https://gist.github.com/dsp9107/07cb6b779c016f29c93c6606414961e3"&gt;this repo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/dsp9107/Simple-Express-App.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Open the directory with VS Code for a convenient experience 😁
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd Simple-Express-App
code .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h1&gt;
  
  
  Usage
&lt;/h1&gt;

&lt;p&gt;We'll get the server running and then move to the interaction part.&lt;/p&gt;
&lt;h3&gt;
  
  
  Starting the Server
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Once VS Code opens, open the integrated terminal with &lt;code&gt;Ctrl + `&lt;/code&gt; if you do not see it at the bottom&lt;/li&gt;
&lt;li&gt;Install the dependencies
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;While the dependencies are being installed, let's tweak our VS Code a bit 😀&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once done, let's start the server
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We can see &lt;code&gt;Listening At somenumber ...&lt;/code&gt;, in the terminal, which we'll call &lt;code&gt;PORT&lt;/code&gt; from here on.&lt;/p&gt;
&lt;h3&gt;
  
  
  Interacting with the Server
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open any browser&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;localhost:PORT/pathVars/helloWorld&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can see the response on the page. Try replacing &lt;code&gt;helloWorld&lt;/code&gt; with &lt;code&gt;somethingElse&lt;/code&gt; in the URL. Those are path variables that are explained below.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Using the URL bar of browsers, you can only make GET requests.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;In this post, I've explained how you can use Postman to interact with our Simple Express App. 😄&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Check out &lt;a href="https://learning.postman.com/docs/getting-started/introduction"&gt;Postman&lt;/a&gt; for a broader set of HTTP methods and API testing functionalities.&lt;/p&gt;

&lt;h1&gt;
  
  
  Explanation
&lt;/h1&gt;

&lt;p&gt;There are comments which explain the most basic stuff.&lt;/p&gt;

&lt;p&gt;This is &lt;code&gt;api.js&lt;/code&gt; explained!&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;There are links down below which you can use to explore further. 😄&lt;/p&gt;

&lt;p&gt;And whenever you save either of the files with or without any changes, the server will restart, thanks to &lt;a href="https://www.npmjs.com/package/nodemon"&gt;nodemon&lt;/a&gt; 🔥&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;It's easier to catch up with a framework when you are familiar with its base programming language than to directly jump to the framework.&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org"&gt;Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://expressjs.com"&gt;Express.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/morgan"&gt;Morgan Middleware&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Further Reads
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to//dsp9107/interacting-with-the-simple-express-app-using-postman-594m"&gt;Interacting with an Express App using Postman&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dsp9107/setting-up-vs-code-for-javascript-development-4a8b"&gt;VS Code Productivity Tips&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>node</category>
      <category>express</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Interacting with the Simple Express App using Postman</title>
      <dc:creator>Dhawal Singh Panwar</dc:creator>
      <pubDate>Mon, 31 Aug 2020 18:12:08 +0000</pubDate>
      <link>https://dev.to/dspsolves/interacting-with-the-simple-express-app-using-postman-594m</link>
      <guid>https://dev.to/dspsolves/interacting-with-the-simple-express-app-using-postman-594m</guid>
      <description>&lt;p&gt;You're familiar with the concept of modularity from OOPS, right? So, my introduction is not in this post. 😆&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Postman is an API client which we are gonna use to interact with this Simple Express App.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dspsolves"&gt;
        dspsolves
      &lt;/a&gt; / &lt;a href="https://github.com/dspsolves/Simple-Express-App"&gt;
        Simple-Express-App
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A very simple Express app for demonstration purposes.
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We'll be referring to this post to set up our Simple Express App.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The agenda is to understand how an API makes client-server interaction convenient 🌱&lt;/p&gt;

&lt;h1&gt;
  
  
  Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Setup

&lt;ul&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Windows&lt;/li&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Usage

&lt;ul&gt;
&lt;li&gt;Building a Request&lt;/li&gt;
&lt;li&gt;Receiving a Response&lt;/li&gt;
&lt;li&gt;Another Request&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;li&gt;Further Reads&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Setup
&lt;/h1&gt;

&lt;p&gt;Before getting down to the interaction part, let's set up our workspace.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;VS Code&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;Simple Express App&lt;/li&gt;
&lt;li&gt;Postman&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Follow &lt;a href="https://dev.to/dsp9107/understanding-the-simple-express-app-node-js-10j5#windows"&gt;these steps&lt;/a&gt; if you do not have the first three prerequisites.&lt;/li&gt;
&lt;li&gt;Get &lt;a href="https://www.postman.com/downloads"&gt;Postman&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Follow &lt;a href="https://dev.to/https://dev.to/dsp9107/understanding-the-simple-express-app-node-js-10j5#windows#linux"&gt;these steps&lt;/a&gt; if you do not have the first three prerequisites.&lt;/li&gt;
&lt;li&gt;Install Postman
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install postman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Usage
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Open Postman&lt;/li&gt;
&lt;li&gt;Sign up if you want or just click on “Skip signing in and take me straight to the app”&lt;/li&gt;
&lt;li&gt;Click on the &lt;code&gt;+&lt;/code&gt; button up in the bar which looks like the Browser Tabs bar.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's take a look around and figure out what all components of Postman we actually need to care about as beginners.&lt;/p&gt;

&lt;p&gt;We'll be utilizing Simple Express App's &lt;a href="https://github.com/dsp9107/Simple-Express-App/blob/master/api/queryParams.md"&gt;API Documentation&lt;/a&gt; to get familiar with Postman 😁&lt;/p&gt;

&lt;h3&gt;
  
  
  Building a Request
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ug1S7Qeo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/8zfl5247q4ze0j6fihyo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ug1S7Qeo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/8zfl5247q4ze0j6fihyo.png" alt="Building a Request" width="800" height="35"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP Method&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See that &lt;code&gt;GET&lt;/code&gt; in the extreme left? Clicking on that drops down a list of all the HTTP methods Postman supports. Leave it as it is.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;URL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just right to the Methods Dropdown is the URL bar. Enter this URL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localhost:9107/queryParams?someKey=someValue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Receiving a Response
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kL7r49kF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/dyntix4zp9xm8uxb0dlf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kL7r49kF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/dyntix4zp9xm8uxb0dlf.png" alt="Receiving a Response" width="749" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clicking on &lt;strong&gt;Send&lt;/strong&gt; will get you this response on the right of your window.&lt;/p&gt;

&lt;p&gt;You can see that the server returned what we sent it as query parameters. So, we can send it as many query parameters as we want and it'll just send those back in the response body.&lt;/p&gt;

&lt;p&gt;At the top, we can see some information in green. Those are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTTP Response Code&lt;/strong&gt; - HTTP has some response codes defined. &lt;code&gt;200&lt;/code&gt; indicates that the request has succeeded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response Time&lt;/strong&gt; - The time it took for the server to reply to our request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response Size&lt;/strong&gt; - This includes the headers, body, and if any cookies returned by the server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can also hover the cursor over the respective tags for more details.&lt;/p&gt;

&lt;h3&gt;
  
  
  Another Request
&lt;/h3&gt;

&lt;p&gt;Let's send the same data, we sent as a query parameter, in the request body so that it isn't visible in the URL of our request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the method to &lt;code&gt;POST&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change the URL
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;localhost:9107/bodyJSON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Just below the URL bar is &lt;strong&gt;Body&lt;/strong&gt;, put &lt;code&gt;{"someKey":"someValue"}&lt;/code&gt; in it.&lt;/li&gt;
&lt;li&gt;Hit &lt;strong&gt;Send&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---rf51luJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/nd4zjiygrvtyirb0kkq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---rf51luJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/nd4zjiygrvtyirb0kkq3.png" alt="Another Request" width="800" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It should look like this. 😁&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This is how you can use Postman to communicate with any server. You just need to be able to interpret the documentation of the API. I don't think there's any convention for an API Doc but they all have pretty much the same information which we have seen above. Remember to have fun 😁&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learning.postman.com/docs/getting-started/introduction"&gt;Postman Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Further Reads
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.blazemeter.com/blog/how-use-postman-manage-and-execute-your-apis"&gt;How to Use Postman to Manage and Execute Your APIs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>node</category>
      <category>express</category>
      <category>postman</category>
    </item>
    <item>
      <title>Setting up VS Code for JavaScript Development</title>
      <dc:creator>Dhawal Singh Panwar</dc:creator>
      <pubDate>Sat, 22 Aug 2020 18:41:27 +0000</pubDate>
      <link>https://dev.to/dspsolves/setting-up-vs-code-for-javascript-development-4a8b</link>
      <guid>https://dev.to/dspsolves/setting-up-vs-code-for-javascript-development-4a8b</guid>
      <description>&lt;p&gt;You're familiar with the concept of modularity from OOPS, right? So, my introduction is not in this post. 😆&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this post, I'll tell you about how you can set up or tweak VS Code to boost productivity and quadruple your development speed, specifically for JavaScript Development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Pretty good text editor. blah blah blah&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs/setup/setup-overview" rel="noopener noreferrer"&gt;Installation (All Platforms)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installation, you can just start writing code. That's it! For JavaScript, of course. For some languages, you need to add extensions for support and IntelliSense to work.&lt;/p&gt;

&lt;p&gt;Either you open a &lt;code&gt;.js&lt;/code&gt; file to begin with or&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + N&lt;/code&gt; to open a new blank file&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Plain Text&lt;/code&gt; down right in the taskbar at the bottom&lt;/li&gt;
&lt;li&gt;Find or type in &lt;code&gt;JavaScript&lt;/code&gt; and the option shall appear, click on it!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You're set!&lt;/p&gt;

&lt;p&gt;You've already doubled your productivity. For more, keep reading. 😀&lt;/p&gt;

&lt;h2&gt;
  
  
  Features you will actually love
&lt;/h2&gt;

&lt;p&gt;There are plenty of features but I'll share just those which have actually helped boost my productivity.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Integrated Terminal&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Pressing &lt;code&gt;Ctrl + `&lt;/code&gt; will open a terminal in your workspace's directory. You can then run npm installations or your node servers right from within VS Code.&lt;/p&gt;

&lt;p&gt;I know the mess it becomes with all those &lt;code&gt;Alt + Tab&lt;/code&gt; window or even desktop switches just to keep a terminal up and keep checking the output of your blood and sweat.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs/editor/integrated-terminal" rel="noopener noreferrer"&gt;Detailed Usage&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;IntelliSense&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I'll keep it simple. IntelliSense basically offers code completions and quick info on the function's parameter list which means it will help you arrange your parameters which you pass when you call a function in the order in which the arguments are originally defined in the function's definition.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmyiu7l8sojq5y9pn6z0e.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmyiu7l8sojq5y9pn6z0e.gif" alt="intellisense in action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can trigger the IntelliSense in any editor window by typing &lt;code&gt;Ctrl + Space&lt;/code&gt; or by typing the dot character (.) in JavaScript.&lt;/p&gt;

&lt;p&gt;IntelliSense for JavaScript is provided out of the box with some other languages too. Although, some languages do need extensions to be downloaded from VS Code marketplace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs/editor/intellisense" rel="noopener noreferrer"&gt;Detailed Usage&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Code Navigation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This comes in handy when your project grows. Forgot how the exported module from your other &lt;code&gt;.js&lt;/code&gt; file imported into your currently open &lt;code&gt;.js&lt;/code&gt; file works?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5b6895szxkwv65oajlie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5b6895szxkwv65oajlie.png" alt="jump to definition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can jump to the definition with &lt;code&gt;ctrl + click&lt;/code&gt; or open the definition to the side with &lt;code&gt;ctrl + alt + click&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You'll be taken to the imported/required module's function or object will take you to the origin file where the function is defined or object is declared.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fivtunn6f7ra353wnwi52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fivtunn6f7ra353wnwi52.png" alt="matching brackets"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best part. Matching brackets will be highlighted as soon as the cursor is near one of them.&lt;/p&gt;

&lt;p&gt;Pressing &lt;code&gt;Ctrl + Shift + \&lt;/code&gt; will take your cursor to the closing bracket of the current section of code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs/editor/editingevolved" rel="noopener noreferrer"&gt;Detailed Usage&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Integrated Version Control&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Don't remember all those git commands? No worries. VS Code comes with integrated version control with Git support in-the-box. That means you don't have to download any extension for Git-based version control systems to work collaboratively on any project.&lt;/p&gt;

&lt;p&gt;Pressing &lt;code&gt;Ctrl + Shift + G&lt;/code&gt; will open the Source Control pane.&lt;/p&gt;

&lt;p&gt;Many other source control providers are available through extensions on the VS Code Marketplace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.atlassian.com/git/tutorials/install-git" rel="noopener noreferrer"&gt;Git Installation (All platforms)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs/editor/versioncontrol" rel="noopener noreferrer"&gt;Detailed Usage&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Support for Emmet snippets&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Inspired by CSS Selectors, Emmet allows you to type shortcuts that are then expanded into full pieces of code. Emmet abbreviation and snippet expansions are enabled by default in &lt;code&gt;html&lt;/code&gt;, &lt;code&gt;css&lt;/code&gt;, &lt;code&gt;jsx&lt;/code&gt;, &lt;code&gt;xml&lt;/code&gt; among other files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg6sjvoi022xlc8jqeswf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg6sjvoi022xlc8jqeswf.gif" alt="emmet in action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you start typing an Emmet abbreviation, you will see the abbreviation displayed in the suggestion list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.emmet.io" rel="noopener noreferrer"&gt;Emmet In Action&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs/editor/emmet" rel="noopener noreferrer"&gt;Detailed Usage&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Extensions specific to .js development
&lt;/h2&gt;

&lt;p&gt;Apart from the in-built features, you can also extend VS Code's functionality with Extensions available in VS Code Marketplace.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;ESlint&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Simply said, it keeps your code clean. If you don't want to spend hours debugging your code, just use this.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Besides checking style, linters are also excellent tools for finding certain classes of bugs, such as those related to variable scope. Assignment to undeclared variables (these leak into the global scope, contaminating it and possibly causing very difficult to find bugs) and the use of undefined variables are examples of errors that are detectable at lint time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;This story was written by Sam Roberts, a Senior Software Engineer at IBM Canada.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Running a linter against your code can tell you many things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if the code adheres to a certain set of syntax conventions&lt;/li&gt;
&lt;li&gt;if the code contains possible sources of problems&lt;/li&gt;
&lt;li&gt;if the code matches a set of standards you or your team define&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It will raise warnings that you, or your tools, can analyze and give you actionable data to improve your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://eslint.org/demo" rel="noopener noreferrer"&gt;Try It&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Prettier&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;There are times when we developers forget about indentation, use wrong quotes, etc. and have to show our code to our mates and it's embarrassing when they have to ask you to use proper spacing and blah blah blah.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscottsauber.files.wordpress.com%2F2017%2F06%2Fprettier1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fscottsauber.files.wordpress.com%2F2017%2F06%2Fprettier1.gif" alt="prettier demonstration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just press &lt;code&gt;Alt + Shift + F&lt;/code&gt; and let Prettier do its amazing job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://prettier.io/playground" rel="noopener noreferrer"&gt;Try It&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;If you have this setup, you'll be writing clean and beautiful JavaScript code in no time and will also make you hate debugging less. 😁&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://code.visualstudio.com/docs" rel="noopener noreferrer"&gt;VS Code Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://scottsauber.com/2017/06/10/prettier-format-on-save-never-worry-about-formatting-javascript-again" rel="noopener noreferrer"&gt;Scott Sauber - Never worry about formatting javascript again&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.litmus.com/blog/what-is-emmet" rel="noopener noreferrer"&gt;Litmus - What is Emmet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/the-node-js-collection/why-and-how-to-use-eslint-in-your-project-742d0bc61ed7" rel="noopener noreferrer"&gt;Sam Roberts - Why (and how) to use eslint in your project&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://flaviocopes.com/eslint" rel="noopener noreferrer"&gt;Flavio Copes - Keep your code clean with ESLint&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vscode</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How did I start my tech journey?</title>
      <dc:creator>Dhawal Singh Panwar</dc:creator>
      <pubDate>Sat, 22 Aug 2020 18:37:07 +0000</pubDate>
      <link>https://dev.to/dspsolves/how-did-i-start-my-tech-journey-53ia</link>
      <guid>https://dev.to/dspsolves/how-did-i-start-my-tech-journey-53ia</guid>
      <description>&lt;p&gt;I'm a software developer with a bias towards JavaScript. I can use JavaScript in its entirety of usefulness to do pretty much everything it can. But, the secret is ...&lt;/p&gt;

&lt;p&gt;&lt;em&gt;to not skip this part and read each and every word&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'm just kidding. Feel free to scroll through my journey.&lt;/p&gt;

&lt;p&gt;We had HTML in grade 8 followed by JavaScript in grade 9 which was around 2012-2013. I started with gedit, a text editor that comes with Ubuntu. &lt;em&gt;Linux? Then? Yes. Our teacher was obsessed with Ubuntu at the time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We started with the basics as any other programming language, i.e., variable, tokens, operators, I/O, and some arithmetic functions. Then came loops, conditions, and we were saturated even before the patterns came along; m types of triangles and n types of ASCII Art.&lt;/p&gt;

&lt;p&gt;Moved to C++ after then till college then JSON caught my eye with its beauty and simplicity. When I dug deep, I found it kinda originated from JavaScript. So frustrated or maybe overwhelmed with C++, I switched back to my old flame, JavaScript, and it was like seeing your school crush after years all grown up and still single. I did what probably you too would do. I caught up with its versions and features.&lt;/p&gt;

&lt;p&gt;When I got mature and finally had a better understanding of web technologies, I realized I still need a server-side language to make sense of my Front-End skills and all I knew was PHP, however efficient or powerful you might say it is, we just don't get along. It was like JavaScript and I were made for each other but her parents wouldn't agree, &lt;em&gt;I'm also very good with analogies&lt;/em&gt;, so again I started leaning away from it and looking for other technologies to try out.&lt;/p&gt;

&lt;p&gt;Python too was around for a while but just as a rebound. I wanted to start developing software but keep away from the traps like Java, .NET, C#, and other general-purpose ones. Quite soon, another very good teacher of mine introduced me to &lt;strong&gt;Node.js&lt;/strong&gt;. I thought this would also come with a huge learning curve but anyways I gave it a try.&lt;/p&gt;

&lt;p&gt;Pretty soon, I was already into Microservices and APIs. This was it. Although Node.js is just a framework, JavaScript is literally all I needed all along. I had a few projects up and running even before I knew promises and the whole asynchronous aspect of Node.js.&lt;/p&gt;

&lt;p&gt;All this time when I was looking around and trying different languages, I thought I was wasting my time so I did one thing which still helps me and will definitely help you, too. I wrote down my ideas.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ideas are shit without execution!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's true. But, till you become capable of executing them, &lt;em&gt;WRITE THEM DOWN&lt;/em&gt;. As soon as I got caught up with ES6 and Node.js libraries like Express, I already had plans for projects to build. Guess what? I started developing actual things that now I use in my day to day life and even other people utilize my work.&lt;/p&gt;

&lt;p&gt;So, it all comes down to one thing. Till you're figuring out your path to freedom, plan out what will you do when you achieve it. The answer to that question will then become your purpose to wake up the next day. 😄&lt;/p&gt;

</description>
      <category>story</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
