Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda