Breeze-Sequelize lets you develop JavaScript applications using the same powerful idioms on the client and server. You can
Breeze JS (breeze-client) is a pure JavaScript library for managing data on the client, much as an ORM manages it on the server.
Breeze JS has an EntityManager that queries entities from the server, keeps them in cache, keeps track of the state of each entity, and saves the changes to the server when requested.
Breeze Sequelize (breeze-sequelize) is a server-side library that works with Sequelize to manage persistence for Breeze client applications. It turns Breeze queries into Sequelize queries, and saves changes to the database using Sequelize.
The Breeze server is designed to be stateless. No long-running transactions, detached objects, or persistent connections are required. Entity state is kept on the client, not the server.
Breeze clients do not require a Breeze server; for example, BreezeJS will also work with existing RESTful APIs. The full power of Breeze comes with supporting the three types of client-server communication.
Breeze client applications make three basic kinds of AJAX calls:
The breeze-sequelize npm package provides a server side framework for translating the results of the breeze query and save HTTP calls into operations against any backend database supported by the node ‘Sequelize’ library.
The node ‘Sequelize’ library is described on github as follows
The Sequelize library provides easy access to MySQL, MariaDB, 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.
Note that In order to use the ‘breeze-sequelize’ library, you do NOT need to interact directly with ‘Sequelize’, so knowledge of how to query or save with ‘Sequelize’ is not actually necessary, but might be helpful.
Standard usage:
var breezeSequelize = require("breeze-sequelize");
Additional libraries ( not actually required but useful for certain operations)
var Sequelize = require('sequelize'); // The actual 'sequelize' library used by 'breeze-sequelize'
var Promise = require('bluebird'); // The Promise implementation used by 'breeze-sequelize'
There are two different URI formats that the Breeze client can use to send queries to the server: OData and JSON.
The Breeze Sequelize server only understands the JSON format, so you’ll need to configure the client:
breeze.core.config.initializeAdapterInstance("uriBuilder", "json");