Skip to content

registerFileHandle and spatial extension? #1793

@nshiab

Description

@nshiab

Hello!

You have great examples showing how to load data from a File handle here: https://duckdb.org/docs/api/wasm/data_ingestion

But this doesn't seem to work with the spatial extension. Here's what I tried to do:

// file is picked by the user with the File API
await db.registerFileHandle(
  file.name,
  file,
  DuckDBDataProtocol.BROWSER_FILEREADER,
  true
);

await c.query(
  `INSTALL spatial; LOAD spatial;
  CREATE OR REPLACE TABLE table1 AS SELECT * FROM ST_Read(`${file.name}`)`
);

But I get this error:

IO Error: Unknown file type

Thank you! 🙏

Originally posted by @nshiab in #1791

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions