Skip to content

Conversation

@pixie79
Copy link

@pixie79 pixie79 commented Nov 16, 2025

What changes are proposed in this pull request?

This PR fixes an issue in the tool generate.rs to handle nested STRUCTS, It also adds an example of how to use nested structs within the code.

@elenagaljak-db
Copy link
Collaborator

Hey @pixie79, thank you for taking the time to look into the code and make this PR! We are really happy to see the community growing! I took a look at the code and I have a couple of questions regarding the changes.

I see that you added support for parsing field_name: TYPE and field_name TYPE (without the colon). In the current version of the SDK we can only parse the one with the colon.

The fetching of the table structure is done in the method fetch_table_info where a request is sent to a uc endpoint and we get back a response which is parsed into TableInfo instance. TableInfo looks like this:

{
  "name": "table_name",
  "catalog_name": "...",
  "schema_name": "...",
  "columns": [
    {
      "name": "...",
      "type_text": "...",
      ...
    }
  ],
  ...
}

From what I’ve seen, columns and type_text always uses colons. So I’m not sure we need to handle the space format? Of course, if you ran into some examples that didn't work, please share them with us.
I tried to make a table with the SQL script you provided in the nested_example and then generate files with the current version of the tool and everything worked as expected.

Other than that, the example looks great and we can definitely keep it. Let me know what you think.

@pixie79
Copy link
Author

pixie79 commented Nov 20, 2025

Hi

not at my computer at the moment. But yes only made the PR as when I fetched the proto schema using the tool from my table via UC it failed to work and errored. This was the fix that let it work correctly

@elenagaljak-db
Copy link
Collaborator

Can you perhaps share the error that you got? And the steps on how to get a repro. I can't seem to reproduce the issue on my side currently.

@elenagaljak-db
Copy link
Collaborator

Hey @pixie79, just following up on this PR, if you happen to have the repro steps, that would help us evaluate the fix.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants