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

refactor needed? import methods in adapters should not know about models #235

Open
robacarp opened this issue Jun 18, 2018 · 2 comments
Open

Comments

@robacarp
Copy link
Member

While updating for Crystal 0.25, I spent some time in the adapters and noticed that each adapter has too much knowledge about the models.

This seems like it could be refactored for Base&import to pass in an Array(Array(DB::Any)) instead of an Array(Model).

I believe that this would keep the separation of concerns more clear. Thoughts @amberframework/granite ?

@Blacksmoke16
Copy link
Contributor

Blacksmoke16 commented Jun 23, 2018

I'll see if i can refactor anything in #197. It gets a little complicated since each database uses slightly different syntax that cannot be abstracted to a generic implementation

@robacarp robacarp changed the title refactor needed? import methods in adapterts should not know about models refactor needed? import methods in adapters should not know about models Jun 23, 2018
@robacarp
Copy link
Member Author

@Blacksmoke16 my thought is that the model#import method can pass a Array(Tuple()) down to the adapters (or something similar). At least I think that would keep the model knowledge away from the adapter#import methods.

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

5 participants