Git Product home page Git Product logo

sequelize's Introduction

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.

Blogposts/Changes

  • v1.4.1: deprecation of node < 0.6, logging customization, ...
  • v1.4.0: postgresql, connection pooling, ...
  • v1.3.0: migrations, cross-database, validations, new listener notation, ...
  • v1.2.1: changes some defaults and some interfaces
  • v1.0.0: complete rewrite

Features

  • Schema definition
  • Schema synchronization/dropping
  • Easy definition of class/instance methods
  • Instance saving/updating/dropping
  • Asynchronous library
  • Associations
  • Importing definitions from single files

Documentation, Examples and Updates

You can find the documentation and announcements of updates on the project's website. If you want to know about latest development and releases, follow me on Twitter. Also make sure to take a look at the examples in the repository. The website will contain them soon, as well.

Collaboration

I'm glad to get pull request if any functionality is missing or something is buggy. But please ... run the tests before you send me the pull request.

Now if you want to contribute but don't really know where to begin don't worry, the steps below will guide you to have a sequelize contributor's environment running in a couple minutes.

1. Prepare the environment

All the following steps consider you already have npm installed in your node.js version 0.4.6 or higher

1.1 MySQL and other external dependencies

Contributing to sequelize requires you to have MySQL up and running in your local environment. The reason for that is that we have test cases that runs against an actual MySQL server and make sure everything is always working.

That is also one of the reasons your features must come with tests: let's make sure sequelize will stay awesome as more features are added as well as that fixed bugs will never come back.

Well, after installing MySQL you also need to create the sequelize test database:

$ echo "CREATE DATABASE sequelize_test;" | mysql -uroot

CLEVER NOTE: your local MySQL install must be with username root without password. If you want to customize that just hack in the tests, but make sure to don't commit your credentials, we don't want to expose your personal data in sequelize codebase ;)

AND ONE LAST THING: Sequelize also supports SQLite. So this should be working on your machine as well :)

2. Install the dependencies

Just "cd" into sequelize directory and run npm install, see an example below:

$ cd path/to/sequelize
$ npm install

3. Run the tests

In order to run the tests you got to run jasmine-node against the spec directory. By the way, there is where you will write new tests if that's the case.

All you need is to run ./node_modules/.bin/jasmine-node spec/, although this is kinda long and boring, so we configures a NPM task and made that less laborious to you :)

$ npm test

4. That's all

Just commit and send pull requests.

Happy hacking and thank you for contributing

Build status

The automated tests we talk about just so much are running on Travis public CI, here is its status:

Build Status

sequelize's People

Contributors

sdepold avatar janmeier avatar danielschwartz avatar vlmonk avatar alexstrat avatar mickhansen avatar reacuna avatar grayt0r avatar swoodtke avatar corpix avatar kioopi avatar sstoiana avatar iizukanao avatar gabrielfalcao avatar andyburke avatar allanca avatar bcg avatar edlin avatar edtsech avatar israeldelahoz avatar lsmark avatar hiddentao avatar rauno56 avatar siruli avatar dgf avatar nov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.