You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using cursor on a query created using unsafe, nothing happens: it never resolves and never calls the argument to cursor. See my MWE below:
constp=require("postgres");constq=p("postgresql://postgres:example@localhost/demo");// this works and prints every rowconsole.log("a:")consta=q`select * from "aircrafts"`.cursor(async(row)=>{console.log(row);});setTimeout(()=>{// this never calls the argument to `cursor` and never resolvesconsole.log("b:")constb=q.unsafe('select * from "aircrafts"').cursor(async(r)=>console.log(r));},1000);
mkdir -p ~/postgres/data
# copy above docker-compose.yml to ~/postgres/docker-compose.yml
cd ~/postgres;
docker-compose up -d;
Add a database called demo to postgres
docker-bash
# select the postgres db container
# install some dependencies
apt update
apt install curl unzip -y
# download a test db dump
curl https://edu.postgrespro.com/demo-small-en.zip > demo.zip
unzip demo.zip
# restore the test db
PGPASSWORD=example psql --username=postgres -f demo-small-en-20170815.sql
The text was updated successfully, but these errors were encountered:
When using
cursor
on a query created usingunsafe
, nothing happens: it never resolves and never calls the argument tocursor
. See my MWE below:Setting up
demo
to postgresThe text was updated successfully, but these errors were encountered: