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 90bfe09b
authored
Aug 24, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed error handling misbehavior
1 parent
e67e43c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
changelog.md
src/Sequelize.js
src/SequelizeTable.js
changelog.md
View file @
90bfe09
...
@@ -34,4 +34,7 @@
...
@@ -34,4 +34,7 @@
# 0.3.0 #
# 0.3.0 #
-
added possibility to define class and instance methods for models
-
added possibility to define class and instance methods for models
-
added import method for loading model definition from a file
-
added import method for loading model definition from a file
\ No newline at end of file
# 0.3.1 #
-
added error handling when defining invalid database credentials
\ No newline at end of file
src/Sequelize.js
View file @
90bfe09
...
@@ -151,15 +151,15 @@ Sequelize.prototype = {
...
@@ -151,15 +151,15 @@ Sequelize.prototype = {
},
},
query
:
function
(
queryString
,
callback
)
{
query
:
function
(
queryString
,
callback
)
{
var
fields
=
[]
var
fields
=
[]
,
var
values
=
[]
values
=
[],
var
self
=
this
self
=
this
,
var
connection
=
require
(
__dirname
+
"/../lib/nodejs-mysql-native/client"
).
createTCPClient
()
connection
=
require
(
__dirname
+
"/../lib/nodejs-mysql-native/client"
).
createTCPClient
()
connection
.
auto_prepare
=
true
connection
.
auto_prepare
=
true
connection
connection
.
auth
(
this
.
config
.
database
,
this
.
config
.
username
,
this
.
config
.
password
)
.
auth
(
this
.
config
.
database
,
this
.
config
.
username
,
this
.
config
.
password
)
.
addListener
(
"error"
,
function
(
err
)
{
callback
(
err
)
})
.
addListener
(
"error"
,
function
(
err
)
{
callback
(
null
,
null
,
err
)
})
.
addListener
(
'authorized'
,
function
()
{
.
addListener
(
'authorized'
,
function
()
{
if
(
!
self
.
options
.
disableLogging
)
if
(
!
self
.
options
.
disableLogging
)
Sequelize
.
Helper
.
log
(
"Executing the query: "
+
queryString
)
Sequelize
.
Helper
.
log
(
"Executing the query: "
+
queryString
)
...
...
src/SequelizeTable.js
View file @
90bfe09
...
@@ -88,14 +88,14 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
...
@@ -88,14 +88,14 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
sequelize
.
query
(
sequelize
.
query
(
Sequelize
.
sqlQueryFor
(
'create'
,
{
table
:
table
.
tableName
,
fields
:
fields
.
join
(
', '
)
}
),
Sequelize
.
sqlQueryFor
(
'create'
,
{
table
:
table
.
tableName
,
fields
:
fields
.
join
(
', '
)
}
),
function
(
err
)
{
if
(
callback
)
callback
(
table
,
err
)
}
function
(
_
,
_
,
err
)
{
if
(
callback
)
callback
(
table
,
err
)
}
)
)
},
},
drop
:
function
(
callback
)
{
drop
:
function
(
callback
)
{
sequelize
.
query
(
sequelize
.
query
(
Sequelize
.
sqlQueryFor
(
'drop'
,
{
table
:
table
.
tableName
}),
Sequelize
.
sqlQueryFor
(
'drop'
,
{
table
:
table
.
tableName
}),
function
(
err
)
{
if
(
callback
)
callback
(
table
,
err
)
}
function
(
_
,
_
,
err
)
{
if
(
callback
)
callback
(
table
,
err
)
}
)
)
},
},
...
...
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