Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit cb245674
authored
Jul 17, 2016
by
Felix Becker
Committed by
Mick Hansen
Jul 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use prototypal inheritance for QueryGenerators (#6291)
instead of _.extend and _.clone
1 parent
95adb78a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
lib/dialects/mssql/query-generator.js
lib/dialects/mysql/query-generator.js
lib/dialects/postgres/query-generator.js
lib/dialects/sqlite/query-generator.js
lib/dialects/mssql/query-generator.js
View file @
cb24567
...
@@ -12,6 +12,8 @@ var throwMethodUndefined = function(methodName) {
...
@@ -12,6 +12,8 @@ var throwMethodUndefined = function(methodName) {
};
};
var
QueryGenerator
=
{
var
QueryGenerator
=
{
/* jshint proto:true */
__proto__
:
AbstractQueryGenerator
,
options
:
{},
options
:
{},
dialect
:
'mssql'
,
dialect
:
'mssql'
,
...
@@ -710,4 +712,4 @@ function wrapSingleQuote(identifier){
...
@@ -710,4 +712,4 @@ function wrapSingleQuote(identifier){
return
Utils
.
addTicks
(
identifier
,
"'"
);
return
Utils
.
addTicks
(
identifier
,
"'"
);
}
}
module
.
exports
=
Utils
.
_
.
extend
(
Utils
.
_
.
clone
(
AbstractQueryGenerator
),
QueryGenerator
)
;
module
.
exports
=
QueryGenerator
;
lib/dialects/mysql/query-generator.js
View file @
cb24567
'use strict'
;
'use strict'
;
const
Utils
=
require
(
'../../utils'
);
const
Utils
=
require
(
'../../utils'
);
const
AbstractQueryGenerator
=
require
(
'../abstract/query-generator'
);
const
QueryGenerator
=
{
const
QueryGenerator
=
{
/* jshint proto:true */
__proto__
:
AbstractQueryGenerator
,
dialect
:
'mysql'
,
dialect
:
'mysql'
,
createSchema
()
{
createSchema
()
{
...
@@ -343,4 +346,4 @@ function wrapSingleQuote(identifier){
...
@@ -343,4 +346,4 @@ function wrapSingleQuote(identifier){
return
Utils
.
addTicks
(
identifier
,
'\''
);
return
Utils
.
addTicks
(
identifier
,
'\''
);
}
}
module
.
exports
=
Utils
.
_
.
extend
(
Utils
.
_
.
clone
(
require
(
'../abstract/query-generator'
)),
QueryGenerator
)
;
module
.
exports
=
QueryGenerator
;
lib/dialects/postgres/query-generator.js
View file @
cb24567
...
@@ -9,6 +9,8 @@ const semver = require('semver');
...
@@ -9,6 +9,8 @@ const semver = require('semver');
const
_
=
require
(
'lodash'
);
const
_
=
require
(
'lodash'
);
const
QueryGenerator
=
{
const
QueryGenerator
=
{
/* jshint proto:true */
__proto__
:
AbstractQueryGenerator
,
options
:
{},
options
:
{},
dialect
:
'postgres'
,
dialect
:
'postgres'
,
...
@@ -801,4 +803,4 @@ const QueryGenerator = {
...
@@ -801,4 +803,4 @@ const QueryGenerator = {
}
}
};
};
module
.
exports
=
Utils
.
_
.
extend
(
Utils
.
_
.
clone
(
AbstractQueryGenerator
),
QueryGenerator
)
;
module
.
exports
=
QueryGenerator
;
lib/dialects/sqlite/query-generator.js
View file @
cb24567
...
@@ -4,13 +4,11 @@
...
@@ -4,13 +4,11 @@
const
Utils
=
require
(
'../../utils'
);
const
Utils
=
require
(
'../../utils'
);
const
Transaction
=
require
(
'../../transaction'
);
const
Transaction
=
require
(
'../../transaction'
);
const
_
=
require
(
'lodash'
);
const
_
=
require
(
'lodash'
);
const
MySqlQueryGenerator
=
require
(
'../mysql/query-generator'
);
const
MySqlQueryGenerator
=
Utils
.
_
.
extend
(
Utils
.
_
.
clone
(
require
(
'../abstract/query-generator'
)),
Utils
.
_
.
clone
(
require
(
'../mysql/query-generator'
))
);
const
QueryGenerator
=
{
const
QueryGenerator
=
{
/* jshint proto:true */
__proto__
:
MySqlQueryGenerator
,
options
:
{},
options
:
{},
dialect
:
'sqlite'
,
dialect
:
'sqlite'
,
...
@@ -349,4 +347,4 @@ const QueryGenerator = {
...
@@ -349,4 +347,4 @@ const QueryGenerator = {
}
}
};
};
module
.
exports
=
Utils
.
_
.
extend
({},
MySqlQueryGenerator
,
QueryGenerator
)
;
module
.
exports
=
QueryGenerator
;
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment