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

schemagen: generate go structs for tables #205

Open
mmatczuk opened this issue Nov 19, 2021 · 6 comments
Open

schemagen: generate go structs for tables #205

mmatczuk opened this issue Nov 19, 2021 · 6 comments

Comments

@mmatczuk
Copy link
Contributor

This is a followup to #201.
We can now generate the table model but still the structs need to written by hand.

Gocqlx supports UDTs automatically by embedding a special marker interface.
Plain fields should be simple to generate.

Overall the tool should gain ability to generate the table structs.

@mmatczuk
Copy link
Contributor Author

@Bobochka maybe you would be interested in this one.

@pavle995
Copy link
Contributor

Hey @mmatczuk, I would like to work on this. I already started doing something, can you take a look? https://github.com/pavle995/gocqlx/tree/structs-tables

@mmatczuk
Copy link
Contributor Author

Nice work, keep it up, it needs some testing.
It will be required to change from gocql.UUID to a different UUID type.

@pavle995
Copy link
Contributor

Thanks for guidelines. I've added test for map_types.go and updated existing test for schemagen.go. I've also added example in test_examples.go. I've changed from gocql.UUID to [16]byte. This may be a silly question, but why we can't use gocql.UUID?

@mmatczuk
Copy link
Contributor Author

There are so many uuid types, we allow for flexibility.
I think the point here is to be able to configure the tool to provide a custom import path for UUID.
Please send a PR if you think this is ready.

@Sumit2202
Copy link

Any update on this issue?

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

No branches or pull requests

3 participants