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 da93914c
authored
Jul 18, 2014
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an issue with dialect.supports for abstract dialect being overwritten
1 parent
322ae24a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
8 additions
and
12 deletions
lib/dialects/mariadb/index.js
lib/dialects/mysql/index.js
lib/dialects/postgres/index.js
lib/dialects/sqlite/index.js
test/associations/has-many.test.js
test/sequelize.test.js
test/sequelize.transaction.test.js
test/support.js
test/timezone.test.js
lib/dialects/mariadb/index.js
View file @
da93914
...
@@ -11,9 +11,7 @@ var MariaDialect = function(sequelize) {
...
@@ -11,9 +11,7 @@ var MariaDialect = function(sequelize) {
this
.
connectionManager
.
initPools
();
this
.
connectionManager
.
initPools
();
};
};
MariaDialect
.
prototype
=
_
.
defaults
({
MariaDialect
.
prototype
=
MySQL
.
prototype
;
'LIMIT ON UPDATE'
:
true
},
MySQL
.
prototype
);
MariaDialect
.
prototype
.
Query
=
Query
;
MariaDialect
.
prototype
.
Query
=
Query
;
...
...
lib/dialects/mysql/index.js
View file @
da93914
...
@@ -11,7 +11,7 @@ var MysqlDialect = function(sequelize) {
...
@@ -11,7 +11,7 @@ var MysqlDialect = function(sequelize) {
this
.
connectionManager
.
initPools
();
this
.
connectionManager
.
initPools
();
};
};
MysqlDialect
.
prototype
.
supports
=
_
.
merge
(
Abstract
.
prototype
.
supports
,
{
MysqlDialect
.
prototype
.
supports
=
_
.
merge
(
_
.
cloneDeep
(
Abstract
.
prototype
.
supports
)
,
{
'VALUES ()'
:
true
,
'VALUES ()'
:
true
,
'LIMIT ON UPDATE'
:
true
,
'LIMIT ON UPDATE'
:
true
,
lock
:
true
,
lock
:
true
,
...
...
lib/dialects/postgres/index.js
View file @
da93914
...
@@ -11,7 +11,7 @@ var PostgresDialect = function(sequelize) {
...
@@ -11,7 +11,7 @@ var PostgresDialect = function(sequelize) {
this
.
connectionManager
.
initPools
();
this
.
connectionManager
.
initPools
();
};
};
PostgresDialect
.
prototype
.
supports
=
_
.
merge
(
Abstract
.
prototype
.
supports
,
{
PostgresDialect
.
prototype
.
supports
=
_
.
merge
(
_
.
cloneDeep
(
Abstract
.
prototype
.
supports
)
,
{
'RETURNING'
:
true
,
'RETURNING'
:
true
,
'DEFAULT VALUES'
:
true
,
'DEFAULT VALUES'
:
true
,
schemas
:
true
,
schemas
:
true
,
...
...
lib/dialects/sqlite/index.js
View file @
da93914
...
@@ -10,7 +10,7 @@ var SqliteDialect = function(sequelize) {
...
@@ -10,7 +10,7 @@ var SqliteDialect = function(sequelize) {
this
.
connectionManager
=
new
ConnectionManager
(
this
,
sequelize
);
this
.
connectionManager
=
new
ConnectionManager
(
this
,
sequelize
);
};
};
SqliteDialect
.
prototype
.
supports
=
_
.
merge
(
Abstract
.
prototype
.
supports
,
{
SqliteDialect
.
prototype
.
supports
=
_
.
merge
(
_
.
cloneDeep
(
Abstract
.
prototype
.
supports
)
,
{
'DEFAULT'
:
false
,
'DEFAULT'
:
false
,
'DEFAULT VALUES'
:
true
,
'DEFAULT VALUES'
:
true
,
index
:
{
index
:
{
...
...
test/associations/has-many.test.js
View file @
da93914
...
@@ -1297,7 +1297,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
...
@@ -1297,7 +1297,7 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
});
});
it
(
'makes join table non-paranoid by default'
,
function
()
{
it
(
'makes join table non-paranoid by default'
,
function
()
{
var
paranoidSequelize
=
new
Sequelize
(
''
,
''
,
''
,
{
var
paranoidSequelize
=
Support
.
createSequelizeInstance
(
{
define
:
{
define
:
{
paranoid
:
true
paranoid
:
true
}
}
...
...
test/sequelize.test.js
View file @
da93914
...
@@ -32,7 +32,6 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
...
@@ -32,7 +32,6 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
,
connectionSpy
=
ConnectionManager
.
prototype
.
connect
=
chai
.
spy
(
ConnectionManager
.
prototype
.
connect
);
,
connectionSpy
=
ConnectionManager
.
prototype
.
connect
=
chai
.
spy
(
ConnectionManager
.
prototype
.
connect
);
var
sequelize
=
Support
.
createSequelizeInstance
({
var
sequelize
=
Support
.
createSequelizeInstance
({
dialect
:
dialect
,
pool
:
{
pool
:
{
minConnections
:
2
minConnections
:
2
}
}
...
...
test/sequelize.transaction.test.js
View file @
da93914
...
@@ -87,7 +87,7 @@ describe(Support.getTestDialectTeaser("Sequelize#transaction"), function () {
...
@@ -87,7 +87,7 @@ describe(Support.getTestDialectTeaser("Sequelize#transaction"), function () {
// how could we enforce an authentication error in sqlite?
// how could we enforce an authentication error in sqlite?
}
else
{
}
else
{
it
(
"gets triggered once an error occurs"
,
function
(
done
)
{
it
(
"gets triggered once an error occurs"
,
function
(
done
)
{
var
sequelize
=
Support
.
createSequelizeInstance
(
{
dialect
:
Support
.
getTestDialect
()
}
);
var
sequelize
=
Support
.
createSequelizeInstance
();
// lets overwrite the host to get an error
// lets overwrite the host to get an error
sequelize
.
config
.
username
=
'foobarbaz'
;
sequelize
.
config
.
username
=
'foobarbaz'
;
...
...
test/support.js
View file @
da93914
...
@@ -68,7 +68,7 @@ var Support = {
...
@@ -68,7 +68,7 @@ var Support = {
createSequelizeInstance
:
function
(
options
)
{
createSequelizeInstance
:
function
(
options
)
{
options
=
options
||
{};
options
=
options
||
{};
options
.
dialect
=
options
.
dialect
||
'mysql'
;
options
.
dialect
=
this
.
getTestDialect
()
;
var
config
=
Config
[
options
.
dialect
];
var
config
=
Config
[
options
.
dialect
];
...
@@ -187,7 +187,7 @@ var Support = {
...
@@ -187,7 +187,7 @@ var Support = {
}
}
};
};
var
sequelize
=
Support
.
createSequelizeInstance
(
{
dialect
:
Support
.
getTestDialect
()
}
);
var
sequelize
=
Support
.
createSequelizeInstance
();
// For Postgres' HSTORE functionality and to properly execute it's commands we'll need this...
// For Postgres' HSTORE functionality and to properly execute it's commands we'll need this...
before
(
function
()
{
before
(
function
()
{
...
...
test/timezone.test.js
View file @
da93914
...
@@ -16,7 +16,6 @@ if (dialect !== 'sqlite') {
...
@@ -16,7 +16,6 @@ if (dialect !== 'sqlite') {
beforeEach
(
function
()
{
beforeEach
(
function
()
{
this
.
sequelizeWithTimezone
=
Support
.
createSequelizeInstance
({
this
.
sequelizeWithTimezone
=
Support
.
createSequelizeInstance
({
timezone
:
'+07:00'
,
timezone
:
'+07:00'
,
dialect
:
dialect
});
});
});
});
...
...
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