Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to excel on windows fails. #142

Open
luusluus opened this issue Nov 29, 2024 · 0 comments
Open

Export to excel on windows fails. #142

luusluus opened this issue Nov 29, 2024 · 0 comments

Comments

@luusluus
Copy link

What happens

When I try to export to excel using the spatial extension in typescript using duckdb-node package I get the following error:

[Error: IO Error: Cannot open file "C:\Users\lucie\tmp_output.xlsx": The system cannot find the file specified.
] {
  errno: -1,
  code: 'DUCKDB_NODEJS_ERROR',
  errorType: 'IO'
}
undefined

I've tried the duckdb CLI and I have written a python client to do the exact same thing and they work as intended.

To Reproduce

Install nodejs v20.9.0

Open command prompt:

npm i -g ts-node
npm i -g duckdb

code:

import * as duckdb from "duckdb";

async function exportExcel () {
    const db = new duckdb.Database(":memory:");
    
    db.all(`
        INSTALL spatial; LOAD spatial;
        COPY (SELECT 1 as a, 2 as b) TO 'C:\\Users\\lucie\\output.xlsx' WITH (FORMAT GDAL, DRIVER 'xlsx');
      `, function(err, res) {
        if (err) {
            console.warn(err);
        } 
        console.log(res);
      }
    );
}

exportExcel().catch((e) => {
    console.log(e);
});

OS:

Microsoft Windows 11 Pro

DuckDB version:

1.1.3

DuckDB Client:

duckdb-node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant