You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, users have to manually install the driver they want to use. However, there is no version constraint on what version of these drivers work with sequelize. Any major release could break sequelize.
Nevertheless, when running npm install sequelize, users get a whole lot of code for dialects they will not use. A much better solution would be if every subfolder of the dialects folder was a seperate module, like sequelize-dialect-postgres. User would then install this, and it would have a dependency on the needed driver version and a peer dependency on sequelize. That way NPM will not allow users to have an old dialect version with a newer, incompatible sequelize version.
The unit tests for the specific dialects would also be moved and run in a seperate CI, which would reduce build time. The integration tests will probably still be run in the main sequelize repo for all dialects.
The unit tests for the specific dialects would also be moved and run in a seperate CI
Keeping tests in sync would be a major issue - If you're considering moving SQL generation aswell.
And if we did have unit tests centralized then it becomes a major issue to make sure the dialect is working.
But there's still an issue with fixing issues that stem from the dialect connector/query generator. It's not ideal having the code and test be in two different repos, you'll need to link while developing (doesn't work in docker containers) and you'll need to publish and bump for each fix.
I definitely want to split it out aswell, but i don't see a fix for testing that won't be totally annoying.
Yes, you are right. To assure that a change to a dialect didn't break anything, the whole test suite including integration tests would have to be run. Which is located in the main repo. The only option would be to truly move every single test that is needed for the dialect aswell.
One option could be to put the complete test suite in a repo sequelize-tests that the main repo and every dialect has a devDependency on. We could link this directly from GitHub, then we don't need to version it with a package.json and publish on NPM. There could be seperate branches for major versions.
@felixfbecker@mickhansen@sushantdhiman Are you guys familiar with lerna? It's a tool for managing multiple packages in a single repo (a "monorepo"), so all of the source code and tests are versioned together, but you can publish them separately to NPM.
Some other big projects mentioned in the link below manage to have monorepos without the tool, but the idea is the same.
Activity
mickhansen commentedon Jul 16, 2016
Keeping tests in sync would be a major issue - If you're considering moving SQL generation aswell.
And if we did have unit tests centralized then it becomes a major issue to make sure the dialect is working.
felixfbecker commentedon Jul 16, 2016
What I meant was that the dialect specific tests would be moved to the different repos too. I don't understand how that would be an issue?
sequelize would have a
devDependencyon each of the dialects for testing.mickhansen commentedon Jul 16, 2016
@felixfbecker Ah, yeah, that would not be a problem. Thought you meant everything dialect specific, which would be sql unit tests aswell :)
mickhansen commentedon Jul 16, 2016
But there's still an issue with fixing issues that stem from the dialect connector/query generator. It's not ideal having the code and test be in two different repos, you'll need to link while developing (doesn't work in docker containers) and you'll need to publish and bump for each fix.
I definitely want to split it out aswell, but i don't see a fix for testing that won't be totally annoying.
felixfbecker commentedon Jul 16, 2016
Yes, you are right. To assure that a change to a dialect didn't break anything, the whole test suite including integration tests would have to be run. Which is located in the main repo. The only option would be to truly move every single test that is needed for the dialect aswell.
One option could be to put the complete test suite in a repo
sequelize-teststhat the main repo and every dialect has adevDependencyon. We could link this directly from GitHub, then we don't need to version it with a package.json and publish on NPM. There could be seperate branches for major versions.sushantdhiman commentedon Jul 16, 2016
Managing version dependency between all
dialects-repo,core-repoandtest-repowill be really hard to maintain and reason aboutfelixfbecker commentedon Aug 19, 2016
I guess we decided against this
mattbrunetti commentedon Apr 18, 2017
@felixfbecker @mickhansen @sushantdhiman Are you guys familiar with lerna? It's a tool for managing multiple packages in a single repo (a "monorepo"), so all of the source code and tests are versioned together, but you can publish them separately to NPM.
Some other big projects mentioned in the link below manage to have monorepos without the tool, but the idea is the same.
https://github.com/lerna/lerna#about
felixfbecker commentedon Apr 19, 2017
Yes, I am. Death to monorepos.