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

Layout #55

Open
Miha-x64 opened this issue Aug 1, 2020 · 0 comments
Open

Layout #55

Miha-x64 opened this issue Aug 1, 2020 · 0 comments

Comments

@Miha-x64
Copy link
Owner

Miha-x64 commented Aug 1, 2020

Many storages do not support nesting. Thus, a Struct must be flattened somehow. Currently, there's no consistent solution across the library:

  • :android-bindings SharedPreferencesStruct serializes a whole field into a Base64'ed String if it is a Collection of non-string or is a Struct,
  • :sql Table has Embedded and NamingConvention to allow embedding Structs into Structs,
  • :http has no support for passing Structs as query parameters or form fields and waiting for this issue resolution.

The proposal is to implement a separate Layout type (inside core :persistence) which will deal with structs and naming conventions, and provide some additional info like hasCollectionsOfStructs, hasMultiDimensionalCollections, hasCollectionsOfNullables etc, so storages could fail instantly and require additional info, if necessary. Inflating and flattening machinery follows Layout and moves to :persistence.

embedded could become automatic everywhere (since SQL-friendly API #32 seems to be good without relations and graph fetching machinery, thus there will be no 1-to-1, 1-to-N, N-to-1, N-to-M relations, only embedding) but we must receive NamingConvention somehow, thus the API question remains open. :sql type() and nativeType() remain within Table as SQL-specific things. SharedPrefs and HTTP could support their own adapters for complicated cases.

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

1 participant