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 380a64e7
authored
Jan 15, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:sdepold/sequelize
2 parents
6343ebb9
c05f7acc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
5 deletions
.gitignore
README.md
lib/migrator.js
lib/utils.js
spec-jasmine/utils.spec.js
.gitignore
View file @
380a64e
...
@@ -4,3 +4,4 @@ test*.js
...
@@ -4,3 +4,4 @@ test*.js
.DS_STORE
.DS_STORE
node_modules
node_modules
npm-debug.log
npm-debug.log
*~
README.md
View file @
380a64e
...
@@ -19,6 +19,33 @@ The Sequelize library provides easy access to MySQL, SQLite or PostgreSQL databa
...
@@ -19,6 +19,33 @@ The Sequelize library provides easy access to MySQL, SQLite or PostgreSQL databa
-
Associations
-
Associations
-
Importing definitions from single files
-
Importing definitions from single files
## Roadmap
A very basic roadmap. Chances aren't too bad, that not mentioned things are implemented as well. Don't panic :)
### 1.6.0 (ToDo)
-
Fix last issues with eager loading of associated data
-
Find out why Person.belongsTo(House) would add person_id to house. It should add house_id to person
### 1.7.0
-
Transactions
-
Support for update of tables without primary key
-
MariaDB support
-
Support for update and delete calls for whole tables without previous loading of instances
-
Eager loading of nested associations
[
#388
](
https://github.com/sdepold/sequelize/issues/388#issuecomment-12019099
)
### 1.7.x
-
Complete support for non-id primary keys
### 1.8.0
-
API sugar (like Model.select().where().group().include().all())
-
Schema dumping
-
enum support
-
attributes / values of a dao instance should be scoped
### 2.0.0
-
save datetimes in UTC
## Documentation, Examples and Updates ##
## Documentation, Examples and Updates ##
You can find the documentation and announcements of updates on the
[
project's website
](
http://www.sequelizejs.com
)
.
You can find the documentation and announcements of updates on the
[
project's website
](
http://www.sequelizejs.com
)
.
...
...
lib/migrator.js
View file @
380a64e
...
@@ -93,7 +93,9 @@ module.exports = (function() {
...
@@ -93,7 +93,9 @@ module.exports = (function() {
callback
&&
callback
(
null
,
result
)
callback
&&
callback
(
null
,
result
)
}
}
var
migrationFiles
=
fs
.
readdirSync
(
this
.
options
.
path
)
var
migrationFiles
=
fs
.
readdirSync
(
this
.
options
.
path
).
filter
(
function
(
file
)
{
return
/
\.
js$/
.
test
(
file
)
})
var
migrations
=
migrationFiles
.
map
(
function
(
file
)
{
var
migrations
=
migrationFiles
.
map
(
function
(
file
)
{
return
new
Migration
(
self
,
self
.
options
.
path
+
'/'
+
file
)
return
new
Migration
(
self
,
self
.
options
.
path
+
'/'
+
file
)
...
...
lib/utils.js
View file @
380a64e
...
@@ -47,10 +47,7 @@ var Utils = module.exports = {
...
@@ -47,10 +47,7 @@ var Utils = module.exports = {
return
connection
.
escape
(
s
).
replace
(
/
\\
"/g
,
'"'
)
return
connection
.
escape
(
s
).
replace
(
/
\\
"/g
,
'"'
)
},
},
format
:
function
(
arr
)
{
format
:
function
(
arr
)
{
var
query
=
arr
[
0
]
return
connection
.
format
.
apply
(
connection
,
[
arr
.
shift
(),
arr
])
,
replacements
=
Utils
.
_
.
compact
(
arr
.
map
(
function
(
obj
)
{
return
obj
!=
query
?
obj
:
null
}))
return
connection
.
format
.
apply
(
connection
,
[
query
,
replacements
])
},
},
isHash
:
function
(
obj
)
{
isHash
:
function
(
obj
)
{
return
Utils
.
_
.
isObject
(
obj
)
&&
!
Utils
.
_
.
isArray
(
obj
);
return
Utils
.
_
.
isObject
(
obj
)
&&
!
Utils
.
_
.
isArray
(
obj
);
...
...
spec-jasmine/utils.spec.js
View file @
380a64e
...
@@ -112,4 +112,16 @@ describe('Utils', function() {
...
@@ -112,4 +112,16 @@ describe('Utils', function() {
expect
(
Utils
.
isHash
(
values
)).
toBeTruthy
();
expect
(
Utils
.
isHash
(
values
)).
toBeTruthy
();
});
});
});
});
describe
(
'format'
,
function
()
{
it
(
'should format where clause correctly when the value is truthy'
,
function
()
{
var
where
=
[
'foo = ?'
,
1
];
expect
(
Utils
.
format
(
where
)).
toEqual
(
'foo = 1'
);
});
it
(
'should format where clause correctly when the value is falsy'
,
function
()
{
var
where
=
[
'foo = ?'
,
0
];
expect
(
Utils
.
format
(
where
)).
toEqual
(
'foo = 0'
);
});
});
})
})
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