berlindb / core

All of the required core code
MIT License
253 stars 27 forks source link

Updates shape_items to be public. #14 #19

Closed alexstandiford closed 4 years ago

alexstandiford commented 4 years ago

This makes it possible to use shape_items in situations where a custom query was written.

JJJ commented 4 years ago

By making this public, we are allowing for anyone to (try to) shape any array of objects. My fear there, isn't just misuse from people implementing Berlin, but rather us as contributors not fully understanding the consequences right now. In addition, once it's public and people begin using it as such, we can't really go backwards without breaking everything.

For your use case, I assume that protected still isn't broad enough?

alexstandiford commented 4 years ago

@JJJ Unfortunately no. I'm running a custom query that needs to shape the resulting data as-if it were used in Berlin. Perhaps if there were a get_results method that worked with a custom query, that ended with shaping the items afterward? That would keep it private, and still allow me to-do what I aim to do.

alexstandiford commented 4 years ago

It seems like this is going to the wayside in-favor of #55. I'm under the impression that if a custom query needs to be ran, the BerlinDB methodology would be to extend the Query class instead of running direct mySQL queries. In this context, shape_items should not be needed.

We can probably 'nix this PR.

JJJ commented 4 years ago

I think you might be correct, @alexstandiford.

Closing this here 👍