-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add mssql pg support
- Loading branch information
Showing
18 changed files
with
156 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
'ues strict'; | ||
'use strict'; | ||
|
||
module.exports = { | ||
write: true, | ||
prefix: '^', | ||
devprefix: '^', | ||
exclude: [ | ||
'test/fixtures', | ||
test: [ | ||
'test', | ||
'benchmark', | ||
], | ||
devdep: [ | ||
'egg', | ||
'egg-ci', | ||
'egg-bin', | ||
'autod', | ||
'eslint', | ||
'eslint-config-egg', | ||
'supertest', | ||
'webstorm-disable-index', | ||
], | ||
keep: [ | ||
], | ||
semver: [ | ||
exclude: [ | ||
'./test/fixtures', | ||
'./docs', | ||
'./coverage', | ||
], | ||
registry: 'https://r.cnpmjs.org', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
test/fixtures | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- | ||
Thank you for your pull request. Please review below requirements. | ||
Bug fixes and new features should include tests and possibly benchmarks. | ||
Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md | ||
感谢您贡献代码。请确认下列 checklist 的完成情况。 | ||
Bug 修复和新功能必须包含测试,必要时请附上性能测试。 | ||
Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md | ||
--> | ||
|
||
##### Checklist | ||
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> | ||
|
||
- [ ] `npm test` passes | ||
- [ ] tests and/or benchmarks are included | ||
- [ ] documentation is changed or added | ||
- [ ] commit message follows commit guidelines | ||
|
||
##### Affected core subsystem(s) | ||
<!-- Provide affected core subsystem(s). --> | ||
|
||
|
||
##### Description of change | ||
<!-- Provide a description of the change below this comment. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
logs/ | ||
logs | ||
npm-debug.log | ||
node_modules/ | ||
coverage/ | ||
.idea/ | ||
.idea/ | ||
run | ||
.DS_Store | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '4' | ||
- '6' | ||
- '7' | ||
install: | ||
- npm i npminstall && npminstall | ||
script: | ||
- npm run ci | ||
after_script: | ||
- npminstall codecov && codecov | ||
services: | ||
- mysql | ||
before_install: | ||
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
'use strict'; | ||
|
||
const loader = require('./lib/loader'); | ||
|
||
module.exports = appOrAgent => { | ||
const done = appOrAgent.readyCallback('agent_sequelize'); | ||
loader(appOrAgent, done); | ||
module.exports = agent => { | ||
require('./lib/loader')(agent); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
'use strict'; | ||
|
||
const loader = require('./lib/loader'); | ||
|
||
module.exports = appOrAgent => { | ||
const done = appOrAgent.readyCallback('worker_sequelize'); | ||
loader(appOrAgent, done); | ||
module.exports = app => { | ||
require('./lib/loader')(app); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
module.exports = { | ||
get model() { | ||
return this.app.sequelize.models; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
exports.sequelize = { | ||
modelPath: 'model', | ||
dialect: 'mysql', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,65 +5,55 @@ | |
"eggPlugin": { | ||
"name": "sequelize" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:eggjs/egg-sequelize.git" | ||
}, | ||
"keywords": [ | ||
"egg", | ||
"sequelize", | ||
"egg-plugin", | ||
"mysql" | ||
"eggPlugin", | ||
"orm" | ||
], | ||
"dependencies": { | ||
"loading": "^1.13.0", | ||
"mysql": "^2.12.0", | ||
"sequelize": "^3.27.0" | ||
"sequelize": "^3.30.1" | ||
}, | ||
"devDependencies": { | ||
"devDependencies": { | ||
"autod": "^2.7.1", | ||
"beautify-benchmark": "^0.2.4", | ||
"benchmark": "^2.1.1", | ||
"egg": "~0.1.0", | ||
"egg-bin": "1", | ||
"egg-ci": "1", | ||
"egg-mock": "^0.0.4", | ||
"egg-view-nunjucks": "~0.3.0", | ||
"eslint": "3", | ||
"eslint-config-egg": "3", | ||
"pedding": "^1.0.0", | ||
"rimraf": "^2.5.2", | ||
"should": "^11.1.0", | ||
"should-http": "^0.0.4", | ||
"spy": "0", | ||
"supertest": "^2.0.0" | ||
"egg": "^0.10.0", | ||
"egg-bin": "^2.0.2", | ||
"egg-ci": "^1.1.0", | ||
"egg-mock": "^2.3.1", | ||
"eslint": "^3.15.0", | ||
"eslint-config-egg": "^3.2.0", | ||
"mysql": "^2.12.0", | ||
"should": "^11.2.0", | ||
"supertest": "^3.0.0", | ||
"webstorm-disable-index": "^1.1.2" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=6.0.0" | ||
}, | ||
"scripts": { | ||
"test": "npm run lint && npm run test-local", | ||
"test": "npm run lint -- --fix && npm run test-local", | ||
"test-local": "egg-bin test", | ||
"cov": "egg-bin cov", | ||
"lint": "eslint --ext js . --fix", | ||
"lint": "eslint .", | ||
"ci": "npm run lint && npm run cov", | ||
"autod": "autod" | ||
}, | ||
"files": [ | ||
"app.js", | ||
"agent.js", | ||
"config", | ||
"app", | ||
"lib" | ||
], | ||
"ci": { | ||
"version": "4, 6" | ||
"version": "6, 7" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/eggjs/egg-sequelize.git" | ||
}, | ||
"files": [ | ||
"agent.js", | ||
"app", | ||
"lib", | ||
"config", | ||
"app.js", | ||
"index.js" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/eggjs/egg/issues" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = sequelize => { | ||
return sequelize.define('test', { | ||
name: { | ||
type: sequelize.Sequelize.STRING(30), | ||
} | ||
}) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
'use strict'; | ||
|
||
require('should'); | ||
|
||
module.exports = function(app) { | ||
app.get('/models', function*() { | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters