duckdb-wasm icon indicating copy to clipboard operation
duckdb-wasm copied to clipboard

Attaching duckdb types while fetching data

Open handstuyennn opened this issue 2 years ago • 2 comments

When I fetch data from duckdb wasm, I guess type of data base on Apache Arrow Field. Sometimes, type couldn't be guessed exactly. Eg, For this query "SELECT -9223372036854775809;".

  • DuckDB Type HUGEINT
  • Apache Arrow store it as DECIMAL

Another example: JSON type is store as Utf8 type in Apache Arrow.

Please let me know if having any way to retrieve exactly type from duckdb.

handstuyennn avatar Sep 20 '22 05:09 handstuyennn

If you insert into a table, you could query the table metadata! https://duckdb.org/docs/sql/information_schema

Alex-Monahan avatar Sep 20 '22 14:09 Alex-Monahan

Hi @Alex-Monahan ,

For Select from table, I could retrieve data types from Duckdb. I mainly focus on SELECT from values. Eg: SELECT interval 1 day;

Thanks

handstuyennn avatar Sep 21 '22 02:09 handstuyennn