Skip to content

Commit

Permalink
The mother of all merges
Browse files Browse the repository at this point in the history
  • Loading branch information
janmeier committed Sep 27, 2013
2 parents 655a603 + 2203db2 commit 8404668
Show file tree
Hide file tree
Showing 150 changed files with 23,884 additions and 9,785 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ test*.js
.DS_STORE
node_modules
npm-debug.log
*~
*~
test/binary/tmp/*
test/tmp/*
4 changes: 2 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"globals": {
"jasmine": false,
"spyOn": false,
"it": false,
"console": false,
Expand All @@ -18,5 +17,6 @@
"unused": true,
"asi": true,
"evil": false,
"laxcomma": true
"laxcomma": true,
"es5": true
}
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ before_script:
- "psql -c 'create database sequelize_test;' -U postgres"

script:
- "npm run test-buster-travis"
- "npm run test-jasmine"
- "make test"

notifications:
email:
- sascha@depold.com
hipchat:
- 40e8850aaba9854ac4c9963bd33f8b@253477
irc:
- "chat.freenode.net#sequelizejs"

env:
- DB=mysql DIALECT=mysql
Expand All @@ -20,4 +23,10 @@ env:
language: node_js

node_js:
- 0.8
- "0.8"
- "0.10"

branches:
only:
- master
- milestones/2.0.0
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
REPORTER ?= dot
TESTS = $(shell find ./test/* -name "*.test.js")
DIALECT ?= mysql

# test commands

teaser:
@echo "" && \
node -pe "Array(20 + '$(DIALECT)'.length + 3).join('#')" && \
echo '# Running tests for $(DIALECT) #' && \
node -pe "Array(20 + '$(DIALECT)'.length + 3).join('#')" && \
echo ''

test:
@make teaser && \
./node_modules/mocha/bin/mocha \
--colors \
--reporter $(REPORTER) \
$(TESTS)

mariadb:
@DIALECT=mariadb make test
sqlite:
@DIALECT=sqlite make test
mysql:
@DIALECT=mysql make test
postgres:
@DIALECT=postgres make test
postgres-native:
@DIALECT=postgres-native make test
binary:
@./test/binary/sequelize.test.bats

# test aliases

pgsql: postgres
postgresn: postgres-native

# test all the dialects \o/

all: sqlite mysql postgres postgres-native mariadb

.PHONY: sqlite mysql postgres pgsql postgres-native postgresn all test
79 changes: 47 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Sequelize #
# Sequelize [![Build Status](https://secure.travis-ci.org/sequelize/sequelize.png)](http://travis-ci.org/sequelize/sequelize) [![Dependency Status](https://david-dm.org/sequelize/sequelize.png)](https://david-dm.org/sequelize/sequelize) [![Dependency Status](https://david-dm.org/sequelize/sequelize.png)](https://david-dm.org/sequelize/sequelize) [![Flattr this](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/1259407/Sequelize) #

The Sequelize library provides easy access to MySQL, SQLite or PostgreSQL databases by mapping database entries to objects and vice versa. To put it in a nutshell... it's an ORM (Object-Relational-Mapper). The library is written entirely in JavaScript and can be used in the Node.JS environment.

<a href="http://flattr.com/thing/1259407/Sequelize" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
MySQL, PostgresSQL, and SQLite Object Relational Mapper (ORM) for [node](http://nodejs.org).

## Important Notes ##

### 2.0.0 ###

There is a parallel "branch" of the project, released as `2.0.0-alphaX` in NPM. All those releases are based on the master
and will get all the changes of the master. However, `2.0.0` will contain backwards compatibility breaking changes. Check the
changelog of the branch: https://github.com/sequelize/sequelize/blob/milestones/2.0.0/changelog.md

### 1.6.0 ###

- We changed the way timestamps are handled. From v1.6.0 on timestamps are stored and loaded as UTC.
Expand All @@ -29,8 +32,10 @@ The Sequelize library provides easy access to MySQL, SQLite or PostgreSQL databa
- Asynchronous library
- Associations
- Importing definitions from single files
- Promises
- Hooks/callbacks/lifecycle events

## Documentation, Examples and Updates ##
## Documentation and Updates ##

You can find the documentation and announcements of updates on the [project's website](http://www.sequelizejs.com).
If you want to know about latest development and releases, follow me on [Twitter](http://twitter.com/sdepold).
Expand All @@ -42,21 +47,27 @@ Also make sure to take a look at the examples in the repository. The website wil
- [Google Groups](https://groups.google.com/forum/#!forum/sequelize)
- [XING](https://www.xing.com/net/priec1b5cx/sequelize) (pretty much inactive, but you might want to name it on your profile)

## Running Examples
Instructions for running samples are located in the [example directory](https://github.com/sequelize/sequelize/tree/master/examples). Try these samples in a live sandbox environment:

<a href="https://runnable.com/sequelize" target="_blank"><img src="https://runnable.com/external/styles/assets/runnablebtn.png"></a>

## Roadmap

A very basic roadmap. Chances aren't too bad, that not mentioned things are implemented as well. Don't panic :)

### 1.7.0
- ~~Check if lodash is a proper alternative to current underscore usage.~~
- Transactions
- Associations of not yet saved objects: [#864](https://github.com/sequelize/sequelize/issues/864)
- Support for update of tables without primary key
- MariaDB support
- ~~Support for update and delete calls for whole tables without previous loading of instances~~ Implemented in [#569](https://github.com/sequelize/sequelize/pull/569) thanks to @optiltude
- Eager loading of nested associations [#388](https://github.com/sdepold/sequelize/issues/388#issuecomment-12019099)
- Model#delete
- Eager loading of nested associations [#388](https://github.com/sequelize/sequelize/issues/388)
- ~~Model#delete~~ (renamed to [Model.destroy()](http://sequelizejs.com/documentation#instances-destroy))
- ~~Validate a model before it gets saved.~~ Implemented in [#601](https://github.com/sequelize/sequelize/pull/601), thanks to @durango
- Move validation of enum attribute value to validate method
- BLOB [#99](https://github.com/sequelize/sequelize/issues/99)
- ~~BLOB~~ [#842](https://github.com/sequelize/sequelize/pull/842), thanks to @janmeier
- ~~Support for foreign keys~~ Implemented in [#595](https://github.com/sequelize/sequelize/pull/595), thanks to @optilude

### 1.7.x
Expand All @@ -70,8 +81,12 @@ A very basic roadmap. Chances aren't too bad, that not mentioned things are impl

### 2.0.0
- ~~save datetimes in UTC~~
- encapsulate attributes if a dao inside the attributes property + add getters and setters
- encapsulate attributes if a dao inside the attributes property
- ~~add getters and setters for dao~~ Implemented in [#538](https://github.com/sequelize/sequelize/pull/538), thanks to iamjochem
- add proper error message everywhere
- refactor validate() output data structure, separating field-specific errors
from general model validator errors (i.e.
`{fields: {field1: ['field1error1']}, model: ['modelError1']}` or similar)


## Collaboration 2.0 ##
Expand Down Expand Up @@ -126,32 +141,27 @@ $ npm install

### 4. Run the tests ###

Right now, the test base is split into the `spec` folder (which contains the
lovely [BusterJS](http://busterjs.org) tests) and the `spec-jasmine` folder
(which contains the ugly and awkward node-jasmine based tests). A main goal
is to get rid of the jasmine tests!
Right now, the test base is split into the `test` folder (which contains the
lovely [Mocha](http://visionmedia.github.io/mocha/) tests).

As you might haven't installed all of the supported SQL dialects, here is how
to run the test suites for your development environment:

```console
$ # run all tests at once:
$ npm test

$ # run only the jasmine tests (for all dialects):
$ npm run test-jasmine

$ # run all of the buster specs (for all dialects):
$ npm run test-buster
$ make all

$ # run the buster specs for mysql:
$ npm run test-buster-mysql
$ make mysql

$ # run the buster specs for sqlite:
$ npm run test-buster-sqlite
$ make sqlite

$ # run the buster specs for postgresql:
$ npm run test-buster-postgres
$ make pgsql

$ # alternatively you can pass database credentials with $variables when testing
$ DIALECT=dialect SEQ_DB=database SEQ_USER=user SEQ_PW=password make test
```

### 5. That's all ###
Expand Down Expand Up @@ -220,20 +230,25 @@ for (var key in obj) {

```js
{
"globals": {
"spyOn": false,
"it": false,
"console": false,
"describe": false,
"expect": false,
"beforeEach": false,
"waits": false,
"waitsFor": false,
"runs": false
},
"camelcase": true,
"curly": true,
"forin": true,
"indent": 2,
"unused": true,
"asi": true,
"evil": false,
"laxcomma": true
"laxcomma": true,
"es5": true
}
```

# Build status

The automated tests we talk about just so much are running on
[Travis public CI](http://travis-ci.org), here is its status:

[![Build Status](https://secure.travis-ci.org/sequelize/sequelize.png)](http://travis-ci.org/sequelize/sequelize)
Loading

0 comments on commit 8404668

Please sign in to comment.