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 6e8793c2
authored
May 11, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1743 from overlookmotel/master
Removed tabs where should be spaces
2 parents
c20fa816
e40e6474
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
30 deletions
lib/dialects/abstract/index.js
lib/dialects/mysql/index.js
lib/dialects/postgres/index.js
lib/dialects/sqlite/index.js
lib/instance-validator.js
lib/query-interface.js
lib/query-types.js
test/dao.test.js
test/sequelize.test.js
lib/dialects/abstract/index.js
View file @
6e8793c
var
AbstractDialect
=
function
()
{
}
AbstractDialect
.
prototype
.
supports
=
{
'RETURNING'
:
false
,
'DEFAULT'
:
true
,
'DEFAULT VALUES'
:
false
,
'VALUES ()'
:
false
,
'LIMIT ON UPDATE'
:
false
,
schemas
:
false
'RETURNING'
:
false
,
'DEFAULT'
:
true
,
'DEFAULT VALUES'
:
false
,
'VALUES ()'
:
false
,
'LIMIT ON UPDATE'
:
false
,
schemas
:
false
}
module
.
exports
=
AbstractDialect
\ No newline at end of file
lib/dialects/mysql/index.js
View file @
6e8793c
...
...
@@ -6,8 +6,8 @@ var MysqlDialect = function(sequelize) {
}
MysqlDialect
.
prototype
.
supports
=
_
.
defaults
({
'VALUES ()'
:
true
,
'LIMIT ON UPDATE'
:
true
'VALUES ()'
:
true
,
'LIMIT ON UPDATE'
:
true
},
Abstract
.
prototype
.
supports
)
module
.
exports
=
MysqlDialect
lib/dialects/postgres/index.js
View file @
6e8793c
...
...
@@ -6,9 +6,9 @@ var PostgresDialect = function(sequelize) {
}
PostgresDialect
.
prototype
.
supports
=
_
.
defaults
({
'RETURNING'
:
true
,
'DEFAULT VALUES'
:
true
,
schemas
:
true
'RETURNING'
:
true
,
'DEFAULT VALUES'
:
true
,
schemas
:
true
},
Abstract
.
prototype
.
supports
)
module
.
exports
=
PostgresDialect
lib/dialects/sqlite/index.js
View file @
6e8793c
...
...
@@ -6,8 +6,8 @@ var SqliteDialect = function(sequelize) {
}
SqliteDialect
.
prototype
.
supports
=
_
.
defaults
({
'DEFAULT'
:
false
,
'DEFAULT VALUES'
:
true
'DEFAULT'
:
false
,
'DEFAULT VALUES'
:
true
},
Abstract
.
prototype
.
supports
)
module
.
exports
=
SqliteDialect
lib/instance-validator.js
View file @
6e8793c
...
...
@@ -253,11 +253,10 @@ InstanceValidator.prototype._builtinAttrValidate = function(value, field) {
// Check for custom validator.
if
(
typeof
test
===
'function'
)
{
return
validators
.
push
(
self
.
_invokeCustomValidator
(
test
,
validatorType
,
true
,
value
,
field
))
return
validators
.
push
(
self
.
_invokeCustomValidator
(
test
,
validatorType
,
true
,
value
,
field
))
}
var
validatorPromise
=
self
.
_invokeBuiltinValidator
(
value
,
test
,
validatorType
,
field
)
;
var
validatorPromise
=
self
.
_invokeBuiltinValidator
(
value
,
test
,
validatorType
,
field
)
// errors are handled in settling, stub this
validatorPromise
.
catch
(
noop
)
validators
.
push
(
validatorPromise
)
...
...
lib/query-interface.js
View file @
6e8793c
...
...
@@ -34,7 +34,7 @@ module.exports = (function() {
if
(
!
this
.
QueryGenerator
.
_dialect
.
supports
.
schemas
)
{
return
this
.
sequelize
.
drop
()
}
else
{
return
this
.
showAllSchemas
().
map
(
function
(
schemaName
,
index
,
length
)
{
return
this
.
showAllSchemas
().
map
(
function
(
schemaName
,
index
,
length
)
{
return
self
.
dropSchema
(
schemaName
)
})
}
...
...
lib/query-types.js
View file @
6e8793c
module
.
exports
=
{
SELECT
:
'SELECT'
,
BULKUPDATE
:
'BULKUPDATE'
,
BULKDELETE
:
'BULKDELETE'
SELECT
:
'SELECT'
,
BULKUPDATE
:
'BULKUPDATE'
,
BULKDELETE
:
'BULKDELETE'
}
\ No newline at end of file
test/dao.test.js
View file @
6e8793c
...
...
@@ -58,7 +58,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
done
()
})
}).
error
(
function
(
err
)
{
done
(
err
);
done
(
err
)
});
})
})
...
...
@@ -943,7 +943,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
expect
(
err
).
to
.
be
.
instanceof
(
Object
)
expect
(
err
.
validateTest
).
to
.
be
.
instanceof
(
Array
)
expect
(
err
.
validateTest
[
0
]).
to
.
exist
expect
(
err
.
validateTest
[
0
].
message
).
to
.
equal
(
'Validation isInt failed'
)
expect
(
err
.
validateTest
[
0
].
message
).
to
.
equal
(
'Validation isInt failed'
)
done
()
})
})
...
...
@@ -956,7 +956,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
expect
(
err
.
validateCustom
).
to
.
exist
expect
(
err
.
validateCustom
).
to
.
be
.
instanceof
(
Array
)
expect
(
err
.
validateCustom
[
0
]).
to
.
exist
expect
(
err
.
validateCustom
[
0
].
message
).
to
.
equal
(
'Length failed.'
)
expect
(
err
.
validateCustom
[
0
].
message
).
to
.
equal
(
'Length failed.'
)
done
()
})
})
...
...
@@ -969,7 +969,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
expect
(
err
.
validateTest
).
to
.
exist
expect
(
err
.
validateTest
).
to
.
be
.
instanceof
(
Array
)
expect
(
err
.
validateTest
[
0
]).
to
.
exist
expect
(
err
.
validateTest
[
0
].
message
).
to
.
equal
(
'Validation isInt failed'
)
expect
(
err
.
validateTest
[
0
].
message
).
to
.
equal
(
'Validation isInt failed'
)
done
()
})
})
...
...
test/sequelize.test.js
View file @
6e8793c
...
...
@@ -98,10 +98,10 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
if
(
dialect
===
'mariadb'
)
{
expect
(
err
.
message
).
to
.
match
(
/Access denied for user/
)
}
else
if
(
dialect
===
'postgres'
)
{
// When the test is run with only it produces:
// Error: Error: Failed to authenticate for PostgresSQL. Please double check your settings.
// When its run with all the other tests it produces:
// Error: invalid port number: "99999"
// When the test is run with only it produces:
// Error: Error: Failed to authenticate for PostgresSQL. Please double check your settings.
// When its run with all the other tests it produces:
// Error: invalid port number: "99999"
expect
(
err
.
message
).
to
.
match
(
/invalid port number/
)
}
else
{
expect
(
err
.
message
).
to
.
match
(
/Failed to authenticate/
)
...
...
@@ -743,7 +743,7 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
it
(
"doesn't save an instance if value is not in the range of enums"
,
function
(
done
)
{
this
.
Review
.
create
({
status
:
'fnord'
}).
error
(
function
(
err
)
{
expect
(
err
).
to
.
be
.
instanceOf
(
Error
);
expect
(
err
.
status
[
0
].
message
).
to
.
equal
(
'Value "fnord" for ENUM status is out of allowed scope. Allowed values: scheduled, active, finished'
)
expect
(
err
.
status
[
0
].
message
).
to
.
equal
(
'Value "fnord" for ENUM status is out of allowed scope. Allowed values: scheduled, active, finished'
)
done
()
})
})
...
...
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