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

SQL in Queries are DB specific #129

Open
JacekSmi opened this issue Oct 13, 2020 · 2 comments
Open

SQL in Queries are DB specific #129

JacekSmi opened this issue Oct 13, 2020 · 2 comments

Comments

@JacekSmi
Copy link

Hi @kgrzybek
First thanks for publishing this repo. I appreciate your work.
When I check part about Queries I see that you are using raw SQL to get data from database what is OK but you are using square bracket what leads you to use MS database.
Problem is that when you want to migrate one module or all app to different DB you will need to rewrite all SQL's 👎

Second thing is that I think all that raw SQL should be moved to a repository class per each module to have it all in one place, so when you will switch to other DB this could be kind of trade-off if you want to stay with square bracket

Please let me know what do you think

@AymanSharaf
Copy link

#126 @kgrzybek Replied to similar concerns (especially the first one) in this issue.

@kgrzybek
Copy link
Owner

kgrzybek commented Nov 4, 2020

Hi @JacekSmi ,

As @AymanSharaf noticed, I answered some time ago to a similar question (second part). TLDR; I advise to not abstract from database on application layer on query side because it does not give you a value. If you want to change db you still need to rewrite SQL statements at some level.

About brackets - imo it is not a big deal because you can remove them easily using find and replace tool. I like to have it, but maybe I think it is matter of choice.

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

No branches or pull requests

3 participants