skip to Main Content

I have an arrow table that I’m trying to query with DuckDB_wasm but I’m getting an error that the table doesn’t exist. I have this…

const dlURL="http://localhost:7071/api/getdata"
const arrowTable  = await tableFromIPC(fetch(dlURL))
const c = await db.connect();

await c.insertArrowTable(arrowTable , {name: 'arrowTable'})
let qres = await c.query("select * from arrowTable")

To be clear, arrowTable definitely exists. I think I’m just missing the proper syntax between insertArrowTable and the subsequent query.

2

Answers


  1. Chosen as BEST ANSWER

    I think I just needed to create the table first

    const c = await db.connect();
    await c.query("create table arrowTable(name VARCHAR, age integer)")
    await c.insertArrowTable(arrowTable , {name: 'arrowTable'})
    let qres = await c.query("select * from arr
    

  2. Thanks for raising this, I will have to double check from a console, but I have a hunch: could you try providing a {schema: 'main', name: 'arrowTable'} as option to insertArrowTable?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search