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

[Feature Request] Compound type support #10

Open
aprock opened this issue Dec 12, 2024 · 5 comments
Open

[Feature Request] Compound type support #10

aprock opened this issue Dec 12, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@aprock
Copy link

aprock commented Dec 12, 2024

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;
}
@vm75
Copy link
Owner

vm75 commented Dec 12, 2024

Thanks @aprock
I will have a go at it this winter.

DuckDB.dart is a cool project as well :)

@vm75 vm75 added the enhancement New feature or request label Dec 12, 2024
@CaptainDario
Copy link

CaptainDario commented Dec 18, 2024

@vm75, this would be awesome.
I am trying to create some simple bindings for the onnx runtime for Dart.
For this, it would be awesome to have web support!

@CaptainDario
Copy link

@vm75 sorry for pinging you, but I wanted to ask you if this is still something you want to work on or if I should rather look for other solutions.

@vm75
Copy link
Owner

vm75 commented Jan 29, 2025 via email

@CaptainDario
Copy link

Thank you for getting back to me and thank you for trying!

It would be awesome to get this working as it would greatly reduce the maintenance burden on the web.

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

No branches or pull requests

3 participants