Package Exports
- sequelize-multi-tenant-enhancer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sequelize-multi-tenant-enhancer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Sequelize Multi Tenant Enhancer
A Proxy based enhancer function which enables schema based multi tenancy in Sequelize.
Installation
yarn add sequelize-multi-tenant-enhancerCaveats
- Requires Proxy support
- Only tested for Sequelize V3
Example code
(Assumes that schemas with tables are already in place)
const enhance = require( 'sequelize-multi-tenant' );
const seq = someFunctionWhichInitializesTheDbAndDefinesAllModels();
const enhancedSeq = enhance( seq );
const clientA = enhancedSeq.withSchema( 'client-a' );
clientA.models.Foobars.findAll()
.then( ( results ) => {
...
} );