Skip to content

insertArrowTable does not create table? #1545

Answered by carlopi
nshiab asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! I have to review wether this could be made simpler for users, but for now you can create the table explicitly like:

{
  const someData = [
    { key1: "a", key2: 1 },
    { key1: "b", key2: 2 }
  ];
  await c.query("CREATE TABLE someData(key1 VARCHAR, key2 integer)");              // <----- create table via SQL
  const arrowTable = arrow.tableFromJSON(someData);
  await c.insertArrowTable(arrowTable, {
    name: "someData"
  });
  return await c.query("select * from someData");
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@nshiab
Comment options

Answer selected by nshiab
Comment options

You must be logged in to vote
2 replies
@jonathanswenson
Comment options

@dioptre
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants