title: How can server side rendering functions utilize DB calls?
body: <p>Since they required data that is fetched <strong>AFTER</strong> build-time, how do I delay the execution of the mentioned functions until the data is received?</p>
  <pre><code>export async function getStaticPaths() {
    // get the paths we want to pre render based on products
   
    const paths = products.map((product) =&gt; ({
      params: { slug: 
        product.slug }
    }));
  console.log(paths,&quot;Paths in getStaticPaths()&quot;)
    return { paths, fallback: false };
  }
  
  export async function getStaticProps({ params }) {
    // get product data based on slug
  
    const product = products.filter((single) =&gt; single.slug === params.slug)[0];
    console.log(product,&quot;In getStaticProps()&quot;)
    return { props: { product } };
  }
  </code></pre>
  <p>In the above, the <code>products</code> contains all the raw data that is imported.</p>
  <p>I need to replace this import of data with an import of a function that returns the data, but I end up with null as the call is not dine yet.</p>