Skip to content

[Feature Request] Compound type support #10

@aprock

Description

@aprock

Great project!

I'm the owner of DuckDB.dart and we're exploring wasm support. I was able to use this to load in the duckdb-wasm binaries, however the bindings fail due to the lack of compound types (struct, union, and array), and const constructors for the primitives.

Any plans to add this support?

here is my ffi generated file with specific examples below of what fails.

final class duckdb_date_struct extends ffi.Struct {
  @ffi.Int32()
  external int year;

  @ffi.Int8()
  external int month;

  @ffi.Int8()
  external int day;
}
...
final class duckdb_string_t extends ffi.Struct {
  external UnnamedUnion1 value;
}

final class UnnamedUnion1 extends ffi.Union {
  external UnnamedStruct1 pointer;

  external UnnamedStruct2 inlined;
}
...
final class UnnamedStruct1 extends ffi.Struct {
  @ffi.Uint32()
  external int length;

  @ffi.Array.multi([4])
  external ffi.Array<ffi.Char> prefix;

  external ffi.Pointer<ffi.Char> ptr;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions