Skip to content

DuckDB Struct parameter example #230

Open

Description

@jhgoodwin

Hi,

Tried to look through the unit tests, docs, and samples, but did not see (maybe I was blind) how to create a parameter for a struct. In my case, specifically, I have an array of struct for the column.

Looking at ClrToDuckDBConverter, it doesn't seem to support this style of conversion. Do you have advice?

If it's not possible, I could use a detail table, but I was experimenting to see if I could avoid the join.

Activity

  1. Giorgi commented on Nov 17, 2024

    @Giorgi
    Owner

    Binding Struct parameters isn't supported at the moment, and I can't say when/if it will be supported. If you are interested in it, you can PInvoke duckdb_create_struct_value function and I can add support for accepting arbitrary duckdb_value-s as a parameter value.

  2. jhgoodwin commented on Nov 17, 2024

    @jhgoodwin
    Author

    Your offer is generous. I think for now, I will use the well understood path until my project is a bit further along. Thank you for your work and support.

  3. Giorgi commented on Nov 17, 2024

    @Giorgi
    Owner

    I'll leave this issue as open, in case others are interested in Struct parameter support.

  4. reopened this on Nov 17, 2024
  5. jcageman commented on Apr 14, 2026

    @jcageman

    the support for this sounds very useful to ingest complex types :) we use C# classes with just properties, but also records/structs would be highly appreciated if they can be mapped. For complex structures such as lists with a struct it's pretty hard to do this right now otherwise right? you would have to make your data simple types List etc..

    Is it possible to already ingest this via the table api perhaps? https://duckdb.net/docs/table-functions.html or some other way? at the moment we serialize our .net list to json, write it to disk and make a typed schema manually to do queries, which feels odd. Especially the fact we need to write to disk feels off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions