Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda