q="select * from example"fetch(`http://127.0.0.1:5654/db/query?q=${encodeURIComponent(q)}`).then(res=>{returnres.json();}).then(data=>{console.log(data)});
CSV
Set format=csv explicitly.
1
2
3
4
5
6
7
8
q="select * from example"fetch(`http://127.0.0.1:5654/db/query?q=${encodeURIComponent(q)}&format=csv`).then(res=>{returnres.text();}).then(data=>{console.log(data)});