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

remove sql code duplication #558

Merged
merged 5 commits into from
May 18, 2021
Merged

remove sql code duplication #558

merged 5 commits into from
May 18, 2021

Conversation

quasart
Copy link
Contributor

@quasart quasart commented Apr 24, 2021

Hello,

I've noticed sql code duplication in project.mml,
I think it's better to factor this code by calling a common sql view. This code factoring should avoid some bugs, and would make future dev and rework easier.

This PR is a POC for roads. I think it could be done for other layers, for instance routes.

What do you think ?

@Phyks
Copy link
Member

Phyks commented Apr 24, 2021

Hi,

Thanks a lot, huge +1 for deduplication here. The same stands for amenities.

Not sure whether we could achieve the dame with yaml variables? Otherwise, psql views are probably fine, i'll just have to quickly double check with osm-fr which is hosting us and providing us with a planet db.

@Phyks
Copy link
Member

Phyks commented Apr 30, 2021

I double checked, it's fine to use SQL views as proposed here!

@quasart
Copy link
Contributor Author

quasart commented May 15, 2021

I eventually couldn’t find nice rework of routes. Do you think other layers should be handled with views ?

@Phyks
Copy link
Member

Phyks commented May 15, 2021

@quasart
Copy link
Contributor Author

quasart commented May 15, 2021

Oh this was done already in 5dfe79d

@Phyks
Copy link
Member

Phyks commented May 16, 2021

Indeed, I missed this extra commit, sorry!

Unless you find other areas of interest for SQL code deduplication (I don't have any in mind), I think this one is ready for review. Would you want to fix conflicts or do you prefer I handle it upon review / merge?

@quasart
Copy link
Contributor Author

quasart commented May 18, 2021

Conflicts fixed ✔️

@Phyks
Copy link
Member

Phyks commented May 18, 2021

Great, thanks!

@Phyks Phyks merged commit 47ddadc into cyclosm:master May 18, 2021
@quasart quasart deleted the codefactoring branch June 1, 2021 08:36
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

Successfully merging this pull request may close these issues.

None yet

2 participants