Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mvc-express-sequelize
Advanced tools
Readme
This is a Sequelize model loader for mvc-express.
const config = require('../config');
const mvc = require('mvc-express');
const modelLoader = require('mvc-express-sequelize')(config);
mvc.boot({
root: __dirname,
modelLoader
})
The config object should include the following values for the current environment.
See the Sequelize docs for more info.
Key | Description |
---|---|
username | The DB username |
password | The DB password for the username |
database | The DB name |
host | The host to be used |
dialect | The SQL DB type to be used by Sequelize |
pool | Optional connection pool describtion |
storage | For SQLLite only |
If you want Sequelize to use process.env
to extract the configs, then use { use_env_variable : true }
.
Each model file will receive as arguments: sequelize
, DataType
, services
, and options
.
Models are attached to the models
object using the Sequelize model name.
Here is a sample model:
// app/models/pages.model.js
// this model will be available as models.Pages
'use strict';
module.exports = function(sequelize, DataTypes, services, options) {
var Pages = sequelize.define('Pages', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: DataTypes.INTEGER
},
title: {
type: DataTypes.STRING
},
slug: {
type: DataTypes.STRING
},
content: {
type: DataTypes.TEXT
},
createdAt: {
allowNull: false,
type: DataTypes.DATE,
defaultValue: DataTypes.NOW
},
updatedAt: {
allowNull: false,
type: DataTypes.DATE
}
}, {
classMethods: {
associate: function(models) {
// associations can be defined here
}
}
});
return Pages;
};
Use the Sequelize CLI for migrations and seeds.
FAQs
This is a [Sequelize](http://docs.sequelizejs.com/) model loader for [mvc-express](https://github.com/pajtai/mvc-express).
The npm package mvc-express-sequelize receives a total of 0 weekly downloads. As such, mvc-express-sequelize popularity was classified as not popular.
We found that mvc-express-sequelize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.