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

built_value codegen support #532

Open
KalilDev opened this issue Jan 5, 2021 · 8 comments · May be fixed by #533
Open

built_value codegen support #532

KalilDev opened this issue Jan 5, 2021 · 8 comments · May be fixed by #533
Labels
enhancement New feature or request

Comments

@KalilDev
Copy link
Contributor

KalilDev commented Jan 5, 2021

Is your feature request related to a problem? Please describe.
I want to start using built_value from now on on my projects, and a big thing that needs adressing is hive support, as i do not want to write TypeAdapter s manually.

Describe the solution you'd like
TypeAdapter codegen being built_value aware, being able to properly read and write like regular classes. Although, full proper support with HiveLists is a whole other beast because of the mutability of the structure

Describe alternatives you've considered
Im preparing the described feature, but i wanted to know if it is an welcome addition to hive in general or if i should keep my changes local.

Version

  • Platform: iOS, Android, Mac, Windows, Linux, Web
  • Hive version: any
@KalilDev KalilDev added the enhancement New feature or request label Jan 5, 2021
@themisir
Copy link
Contributor

themisir commented Jan 5, 2021

I haven't tried built_value yet. So I don't know how does it works. We haven't planned to extend code generator library to support value builders. But any contributions are welcome if you want to add build_value support to hive. 😁

@KalilDev
Copy link
Contributor Author

KalilDev commented Jan 6, 2021

Alright, my draft should support most built_value features, ill open an wip pr while i implement the remaining (EnumClass)

@KalilDev
Copy link
Contributor Author

KalilDev commented Jan 6, 2021

#533

@themisir themisir linked a pull request Jan 7, 2021 that will close this issue
@mrdavidrees
Copy link

This is great. Worked a treat with my existing BuiltValue classes.

@martipello
Copy link

martipello commented Jun 30, 2021

This is great. Worked a treat with my existing BuiltValue classes.

How did you manage this? did you just check out his PR and have it locally?
and if so which commit did you take?
im looking at this one https://github.com/hivedb/hive/tree/9c223e7519ed984991ad31e9064e1d2fe5ecebf4

@martipello
Copy link

works for me also however its not null safe, ive started going through to try and make it null safe but its gonna take too long for me to commit to it

@Leptopoda
Copy link

Leptopoda commented Feb 19, 2023

any new on this?
I'd love to help moving this forward

@danielgomezrico
Copy link

danielgomezrico commented Mar 1, 2024

Theres a repo that adds support, it generates the adapters fine and its also null safe:

https://pub.dev/packages/hive_built_value

But it has some inconsistencies and since that is not official I'm worried on long-term support.

For example this function is not in there:

Hive.resetAdapters();

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

Successfully merging a pull request may close this issue.

6 participants