Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
Fetch Data from Snowflake to nodejs

I am trying to design an API using Snowflake and Nodejs. For that I am using the following things :

Express ejs snowflake-sdk (nodejs module)

I want to fetch data from snowflake and want to display it on my ejs webpage. Please help if anyone has fetched data and populated it on a webpage using nodejs and snowflake.

this is my server.js file

const express = require("express");
const app= express();
const sql = require("./snowflake");

app.use(express.static("public"));
app.use(express.urlencoded({ extended: true}));
app.set("view engine","ejs");

app.get("/", function(request,response){
    response.render("index");
});

app.get("/request/:core", async function(request,response){
    let core=await sql.getCore(request.params.core_name);
    response.render("request",{request: core});
});






const http = require('http');
const port=3000;
const server=http.createServer(function(req,res){
})
const listener = app.listen(port,function(error){
    if(error){
        console.log("Something went wrong due :", error);
    }
    else{
        console.log('Server is listening port '+port);
    }
})

This is my database.js file. I am able to connect to snowflake and run queries but can't understand, how to fetch the query result on the ejs webpage.

const { initParams } = require('request');
const sql = require('snowflake-sdk');

const connection = sql.createConnection({
    
    account: 'account_name',
    authenticator: 'SNOWFLAKE',
    username: 'username',
    password: 'password',
    database: 'database',
    schema: 'schema'

});

module.exports.getCore = async() =>{
    connection.execute({
    sqlText: 'Select column from Table_name',
    complete: async function(err,stmt,rows){
        let pool= await sql.connect();     
        return rows;
    }
})
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is a sample application that you can try to compare, is written on node.js. It is a Citi Bike dashboard that lets users view bike usage over time and in differing weather conditions. The source code is available on GitHub.

More details: https://quickstarts.snowflake.com/guide/data_app/#4

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!