I'm using Deno Oak + pgsql db and i want to extract this table from PostgreSQL :
and put it as an array into js variable, how can i do that ?
Here is the function i used :
const recapPanier = async(ctx:any)=>{
try{
const getPanierData = await client.queryArray`SELECT * FROM panierencours;`;
console.log(getPanierData);
ctx.render('./OBV/panier/panier.ejs',{data: getPanierData});
}catch(err){
console.log(err);
}finally{
await client.end();
}
}
as you can see, it should render a page with the data variable but instead to have the data i have this : [object Object]. notice that I'm using EJS to render front-end content.